#include <pwm_ng.h>
#include <timer.h>
#include <scheduler.h>
-#include <time.h>
+#include <clock_time.h>
#include <adc.h>
#include <pid.h>
#include "cs.h"
#include "i2c_protocol.h"
-#if __AVR_LIBC_VERSION__ == 10602UL
-#error "won't work with this version"
-#endif
-
/* 0 means "programmed"
* ---- with 16 Mhz quartz
* CKSEL 3-0 : 0111
struct genboard gen;
struct mainboard mainboard;
-struct mechboard mechboard;
-struct sensorboard sensorboard;
+struct cobboard cobboard;
+struct ballboard ballboard;
/***********************/
memset(&mainboard, 0, sizeof(mainboard));
mainboard.flags = DO_ENCODERS | DO_RS |
DO_POS | DO_POWER | DO_BD;
- sensorboard.opponent_x = I2C_OPPONENT_NOT_THERE;
/* UART */
uart_init();
# error not supported
#endif
- //eeprom_write_byte(EEPROM_MAGIC_ADDRESS, EEPROM_MAGIC_MAINBOARD);
+ eeprom_write_byte(EEPROM_MAGIC_ADDRESS, EEPROM_MAGIC_MAINBOARD);
/* check eeprom to avoid to run the bad program */
if (eeprom_read_byte(EEPROM_MAGIC_ADDRESS) !=
EEPROM_MAGIC_MAINBOARD) {
PWM_NG_TIMER_16BITS_INIT(4, TIMER_16_MODE_PWM_10,
TIMER4_PRESCALER_DIV_1);
- PWM_NG_INIT16(&gen.pwm1_4A, 4, A, 10, PWM_NG_MODE_SIGNED |
- PWM_NG_MODE_SIGN_INVERTED, &PORTD, 4);
+ PWM_NG_INIT16(&gen.pwm1_4A, 4, A, 10, PWM_NG_MODE_SIGNED,
+ &PORTD, 4);
PWM_NG_INIT16(&gen.pwm2_4B, 4, B, 10, PWM_NG_MODE_SIGNED |
PWM_NG_MODE_SIGN_INVERTED, &PORTD, 5);
PWM_NG_INIT16(&gen.pwm3_1A, 1, A, 10, PWM_NG_MODE_SIGNED,
NULL, 0);
PWM_NG_INIT16(&gen.servo4, 5, C, 10, PWM_NG_MODE_NORMAL,
NULL, 0);
- pwm_ng_set(&gen.servo2, 290); /* right */
- pwm_ng_set(&gen.servo3, 400); /* left */
- /* 2 lintels 180, 485 */
- /* 1 lintel 155, 520 */
+ support_balls_deploy(); /* init pwm for servos */
/* SCHEDULER */
scheduler_init();