/* Main program entry point. This routine configures the hardware required by the application, then enters a loop to run the application tasks in sequence.  */
int main(void)
/* Main program entry point. This routine configures the hardware required by the application, then enters a loop to run the application tasks in sequence.  */
int main(void)
{
	SetupHardware();
	LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
	GlobalInterruptEnable();
	while (RunBootloader || TicksSinceLastCommand++ < 0xFF)
	{
		MS_Device_USBTask(&Disk_MS_Interface);
		USB_USBTask();
	}
	_delay_us(1000);
	USB_Detach();
	MagicBootKey = MAGIC_BOOT_KEY;
	wdt_enable(WDTO_250MS);
	for (;;);
}