Speed up Mass Storage bootloader by turning off the internal clock divider, as there...
authorDean Camera <dean@fourwalledcubicle.com>
Mon, 18 Mar 2013 17:27:18 +0000 (17:27 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Mon, 18 Mar 2013 17:27:18 +0000 (17:27 +0000)
Bootloaders/MassStorage/BootloaderMassStorage.c
Bootloaders/MassStorage/BootloaderMassStorage.h

index a5e953a..c891f85 100644 (file)
@@ -104,6 +104,9 @@ static void SetupHardware(void)
        MCUSR &= ~(1 << WDRF);
        wdt_disable();
 
        MCUSR &= ~(1 << WDRF);
        wdt_disable();
 
+       /* Disable clock division */
+       clock_prescale_set(clock_div_1);
+
        /* Relocate the interrupt vector table to the bootloader section */
        MCUCR = (1 << IVCE);
        MCUCR = (1 << IVSEL);
        /* Relocate the interrupt vector table to the bootloader section */
        MCUCR = (1 << IVCE);
        MCUCR = (1 << IVSEL);
index dd67381..05b0eed 100644 (file)
@@ -39,6 +39,7 @@
        /* Includes: */
                #include <avr/io.h>
                #include <avr/wdt.h>
        /* Includes: */
                #include <avr/io.h>
                #include <avr/wdt.h>
+               #include <avr/power.h>
                #include <avr/interrupt.h>
                #include <string.h>
 
                #include <avr/interrupt.h>
                #include <string.h>