imuboard: remove references to xbee
[fpv.git] / imuboard / main.c
index bee118f..5410074 100644 (file)
 #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"
@@ -64,9 +70,6 @@
 struct imuboard imuboard;
 volatile uint32_t global_ms;
 
-/* global xbee device */
-struct xbee_dev *xbee_dev;
-
 void bootloader(void)
 {
 #define BOOTLOADER_ADDR 0x3f000
@@ -140,9 +143,6 @@ static void main_timer_interrupt(void)
                LED2_OFF();
 }
 
-/* XXX */
-int sd_main(void);
-
 int main(void)
 {
        DDRB = 0x18 /* LEDs */;
@@ -156,6 +156,17 @@ int main(void)
 
        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);
@@ -173,24 +184,28 @@ int main(void)
        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();
        }