#include "cs.h"
#include "strat_base.h"
#include "strat_db.h"
+#include "strat_avoid.h"
#include "i2c_protocol.h"
+#include "beacon.h"
+
/* 0 means "programmed"
* ---- with 16 Mhz quartz
struct mainboard mainboard;
volatile struct cobboard cobboard;
volatile struct ballboard ballboard;
+volatile struct beaconboard beaconboard;
#ifndef HOST_VERSION
/***********************/
memset(&mainboard, 0, sizeof(mainboard));
mainboard.flags = DO_ENCODERS | DO_CS | DO_RS |
DO_POS | DO_POWER | DO_BD | DO_ERRBLOCKING;
+ ballboard.lcob = I2C_COB_NONE;
+ ballboard.rcob = I2C_COB_NONE;
+
+ beaconboard.oppx = I2C_OPPONENT_NOT_THERE;
+ beaconboard.posx = I2C_BEACON_NOT_FOUND;
/* UART */
uart_init();
/* TIME */
time_init(TIME_PRIO);
-#ifndef HOST_VERSION
/* sensors, will also init hardware adc */
sensor_init();
+ /* beacon */
+ beacon_init();
+
+#ifndef HOST_VERSION
/* start i2c slave polling */
scheduler_add_periodical_event_priority(i2c_poll_slaves, NULL,
8000L / SCHEDULER_UNIT, I2C_POLL_PRIO);
/* strat */
gen.logs[0] = E_USER_STRAT;
gen.log_level = 5;
- strat_db_init();
/* strat-related event */
scheduler_add_periodical_event_priority(strat_event, NULL,
- 10000L / SCHEDULER_UNIT,
+ 25000L / SCHEDULER_UNIT,
STRAT_PRIO);
#ifndef HOST_VERSION
sei();
+ strat_db_init();
+
printf_P(PSTR("\r\n"));
printf_P(PSTR("Respect et robustesse.\r\n"));
#ifndef HOST_VERSION