X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/be33d3a5156ea3fde221c9e174ad0405eb8d1f8d..c757acf1f7f3f45522024af7adf8df71a42a1dc1:/Bootloaders/MassStorage/BootloaderMassStorage.c diff --git a/Bootloaders/MassStorage/BootloaderMassStorage.c b/Bootloaders/MassStorage/BootloaderMassStorage.c index a5e953a5b..28f42b6d2 100644 --- a/Bootloaders/MassStorage/BootloaderMassStorage.c +++ b/Bootloaders/MassStorage/BootloaderMassStorage.c @@ -69,8 +69,25 @@ void Application_Jump_Check(void) /* Enable pull-up on the IO13 pin so we can use it to select the mode */ PORTC |= (1 << 7); Delay_MS(10); + + /* If IO13 is not jumpered to ground, start the user application instead */ JumpToApplication |= ((PINC & (1 << 7)) != 0); + + /* Disable pull-up after the check has completed */ PORTC &= ~(1 << 7); + #elif ((BOARD == BOARD_XPLAIN) || (BOARD == BOARD_XPLAIN_REV1)) + /* Disable JTAG debugging */ + JTAG_DISABLE(); + + /* Enable pull-up on the JTAG TCK pin so we can use it to select the mode */ + PORTF |= (1 << 4); + Delay_MS(10); + + /* If the TCK pin is not jumpered to ground, start the user application instead */ + JumpToApplication |= ((PINF & (1 << 4)) != 0); + + /* Re-enable JTAG debugging */ + JTAG_ENABLE(); #endif if (JumpToApplication) @@ -104,6 +121,9 @@ 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);