#include <i2c.h>
#include "eeprom_config.h"
+#include "gps.h"
+#ifdef GPS_VENUS
#include "gps_venus.h"
+#endif
+#ifdef GPS_UBX
+#include "gps_ubx.h"
+#endif
#include "sd_log.h"
#include "../common/i2c_commands.h"
#include "i2c_protocol.h"
struct imuboard imuboard;
volatile uint32_t global_ms;
-/* global xbee device */
-struct xbee_dev *xbee_dev;
-
void bootloader(void)
{
#define BOOTLOADER_ADDR 0x3f000
LED2_OFF();
}
-/* XXX */
-int sd_main(void);
-
int main(void)
{
DDRB = 0x18 /* LEDs */;
callout_mgr_init(&imuboard.intr_cm, get_time_ms);
+#if 0
+ sei(); //XXX
+ printf_P(PSTR("starting...\r\n"));
+ while (1) {
+ int16_t c;
+ c = uart_recv_nowait(0);
+ if (c >= 0)
+ printf("%x\n", (uint8_t)c);
+ }
+#endif
+
cmdline_init();
/* LOGS */
error_register_emerg(mylog);
i2c_register_recv_event(i2c_recvevent);
i2c_register_send_event(i2c_sendevent);
+ sei();
+ printf_P(PSTR("starting...\r\n"));
eeprom_load_config();
sd_log_open();
- sei();
-
printf_P(PSTR("\r\n"));
rdline_newline(&imuboard.rdl, imuboard.prompt);
- //sd_main();
imu_init();
+#ifdef GPS_VENUS
gps_venus_init();
+#endif
+#ifdef GPS_UBX
+ gps_ubx_init();
+#endif
imuboard.flags |= IMUBOARD_F_BOOT_OK;
while (1) {
- //imu_log();
- //gps_log();
+ imu_log(0);
+ gps_log(0);
cmdline_poll();
}