diff options
author | Dean Camera <[email protected]> | 2013-03-18 17:18:11 +0000 |
---|---|---|
committer | Dean Camera <[email protected]> | 2013-03-18 17:18:11 +0000 |
commit | be33d3a5156ea3fde221c9e174ad0405eb8d1f8d (patch) | |
tree | b027f4af999f39ed4554270c089a003479be7af7 /Bootloaders/MassStorage/BootloaderMassStorage.c | |
parent | f8a1dc7424cd83f2f3e87274010d379a661b76e4 (diff) | |
download | qmk_firmware-be33d3a5156ea3fde221c9e174ad0405eb8d1f8d.tar.gz qmk_firmware-be33d3a5156ea3fde221c9e174ad0405eb8d1f8d.zip |
Update Mass Storage bootloader so that it can support devices with only 4KB bootloader sections by creating a special AUX section before the real bootloader section to store part of the bootloader code.
Diffstat (limited to 'Bootloaders/MassStorage/BootloaderMassStorage.c')
-rw-r--r-- | Bootloaders/MassStorage/BootloaderMassStorage.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/Bootloaders/MassStorage/BootloaderMassStorage.c b/Bootloaders/MassStorage/BootloaderMassStorage.c index 7adeaced7a..a5e953a5b0 100644 --- a/Bootloaders/MassStorage/BootloaderMassStorage.c +++ b/Bootloaders/MassStorage/BootloaderMassStorage.c @@ -61,6 +61,25 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface = }; +void Application_Jump_Check(void) +{ + bool JumpToApplication = false; + + #if (BOARD == BOARD_LEONARDO) + /* Enable pull-up on the IO13 pin so we can use it to select the mode */ + PORTC |= (1 << 7); + Delay_MS(10); + JumpToApplication |= ((PINC & (1 << 7)) != 0); + PORTC &= ~(1 << 7); + #endif + + if (JumpToApplication) + { + // cppcheck-suppress constStatement + ((void (*)(void))0x0000)(); + } +} + /** Main program entry point. This routine configures the hardware required by the application, then * enters a loop to run the application tasks in sequence. */ @@ -85,9 +104,6 @@ static void SetupHardware(void) 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); |