Speed up Mass Storage bootloader by turning off the internal clock divider, as there is enough FLASH space to do so.

pull/1469/head
Dean Camera 12 years ago
parent 1703283893
commit 88bcc6fde5

@ -104,6 +104,9 @@ static void SetupHardware(void)
MCUSR &= ~(1 << WDRF); MCUSR &= ~(1 << WDRF);
wdt_disable(); wdt_disable();
/* Disable clock division */
clock_prescale_set(clock_div_1);
/* Relocate the interrupt vector table to the bootloader section */ /* Relocate the interrupt vector table to the bootloader section */
MCUCR = (1 << IVCE); MCUCR = (1 << IVCE);
MCUCR = (1 << IVSEL); MCUCR = (1 << IVSEL);

@ -39,6 +39,7 @@
/* Includes: */ /* Includes: */
#include <avr/io.h> #include <avr/io.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include <avr/power.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <string.h> #include <string.h>

Loading…
Cancel
Save