X-Git-Url: http://git.droids-corp.org/?p=protos%2Fxbee-avr.git;a=blobdiff_plain;f=main.c;h=2120a62451643efd35dcccad963c6468f79dcffe;hp=73a3409cb32a246c3b15487f4fe6a23d292e2155;hb=701d7cbf7d30c49e1d21943ce47d00bf250c70e7;hpb=57895b3bb2fe0582c589685b7df34f3968b346ec diff --git a/main.c b/main.c index 73a3409..2120a62 100644 --- a/main.c +++ b/main.c @@ -517,7 +517,6 @@ void xbee_unload_timeout(struct xbee_ctx *ctx) void bootloader(void) { -#ifndef USE_USB #define BOOTLOADER_ADDR 0x3f000 if (pgm_read_byte_far(BOOTLOADER_ADDR) == 0xff) { printf_P(PSTR("Bootloader is not present\r\n")); @@ -541,7 +540,6 @@ void bootloader(void) /* __asm__ __volatile__ ("ldi r31,0xf8\n"); */ /* __asm__ __volatile__ ("ldi r30,0x00\n"); */ /* __asm__ __volatile__ ("eijmp\n"); */ -#endif } void xbee_mainloop(void) @@ -577,12 +575,6 @@ void xbee_mainloop(void) cmdline_poll(); xbee_proto_rx(xbee_dev); } - -#ifdef USE_USB - CDC_Device_USBTask(&VirtualSerial1_CDC_Interface); - CDC_Device_USBTask(&VirtualSerial2_CDC_Interface); - USB_USBTask(); -#endif } } @@ -601,14 +593,7 @@ static void do_led_blink(struct callout_manager *cm, (void)clt; (void)dummy; -#ifdef USE_USB - if (a & 1) - LEDs_SetAllLEDs(0); - else - LEDs_SetAllLEDs(0xff); -#else /* XXX */ -#endif a++; } @@ -637,14 +622,8 @@ int main(void) int8_t err; struct xbee_dev dev; -#ifdef USE_USB - SetupHardware(); - - LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); -#else uart_init(); uart_register_rx_event(CMDLINE_UART, emergency); -#endif fdevopen(cmdline_dev_send, cmdline_dev_recv); xbee_file = fdevopen(xbee_dev_send, xbee_dev_recv); @@ -657,11 +636,10 @@ int main(void) LED_PRIO); cmdline_init(); spi_servo_init(); -#ifndef USE_USB - /* in usb mode, it's done in usb callback */ + printf_P(PSTR("\r\n")); rdline_newline(&xbeeboard.rdl, xbeeboard.prompt); -#endif + callout_manager_init(&cm, get_time_ms); callout_reset(&cm, &t1, 500, PERIODICAL, do_led_blink, NULL);