/** Main program entry point. This routine contains the overall program flow, including initial * setup of all components and the main program loop. */ int main(void) { SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); GlobalInterruptEnable(); for (;;) { if (CurrentFirmwareMode == MODE_USART_BRIDGE) UARTBridge_Task(); else AVRISP_Task(); USB_USBTask(); } }
/** Main program entry point. This routine contains the overall program flow, including initial * setup of all components and the main program loop. */ int main(void) { SetupHardware(); V2Protocol_Init(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); sei(); for (;;) { #if (BOARD == BOARD_USBTINYMKII) /* On the USBTINY-MKII target, there is a secondary LED which indicates the current selected power mode - either VBUS, or sourced from the VTARGET pin of the programming connectors */ LEDs_ChangeLEDs(LEDMASK_VBUSPOWER, (PIND & (1 << 0)) ? 0 : LEDMASK_VBUSPOWER); #endif AVRISP_Task(); USB_USBTask(); } }