Make sure that long reads are aborted early if the connection times out while waiting...
[pub/USBasp.git] / Bootloaders / TeensyHID / TeensyHID.c
index a11aea8..5431a57 100644 (file)
@@ -1,13 +1,13 @@
 /*\r
              LUFA Library\r
 /*\r
              LUFA Library\r
-     Copyright (C) Dean Camera, 2009.\r
+     Copyright (C) Dean Camera, 2010.\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
-  Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
 \r
   Permission to use, copy, modify, distribute, and sell this \r
   software and its documentation for any purpose is hereby granted\r
 \r
   Permission to use, copy, modify, distribute, and sell this \r
   software and its documentation for any purpose is hereby granted\r
@@ -49,6 +49,9 @@ int main(void)
        /* Setup hardware required for the bootloader */\r
        SetupHardware();\r
        \r
        /* Setup hardware required for the bootloader */\r
        SetupHardware();\r
        \r
+       /* Enable global interrupts so that the USB stack can function */\r
+       sei();\r
+\r
        while (RunBootloader)\r
          USB_USBTask();\r
        \r
        while (RunBootloader)\r
          USB_USBTask();\r
        \r
@@ -68,9 +71,6 @@ void SetupHardware(void)
        MCUSR &= ~(1 << WDRF);\r
        wdt_disable();\r
 \r
        MCUSR &= ~(1 << WDRF);\r
        wdt_disable();\r
 \r
-       /* Disable clock division */\r
-       clock_prescale_set(clock_div_1);\r
-\r
        /* Relocate the interrupt vector table to the bootloader section */\r
        MCUCR = (1 << IVCE);\r
        MCUCR = (1 << IVSEL);\r
        /* Relocate the interrupt vector table to the bootloader section */\r
        MCUCR = (1 << IVCE);\r
        MCUCR = (1 << IVSEL);\r