X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/199cf8f1830ef1a8db14d311d6bfff26b82ef623..9d988fdc222ad518afa9cfcaaa97b5e8768fd483:/Bootloaders/MassStorage/BootloaderMassStorage.c diff --git a/Bootloaders/MassStorage/BootloaderMassStorage.c b/Bootloaders/MassStorage/BootloaderMassStorage.c index c891f8516..61f8760f8 100644 --- a/Bootloaders/MassStorage/BootloaderMassStorage.c +++ b/Bootloaders/MassStorage/BootloaderMassStorage.c @@ -73,6 +73,21 @@ void Application_Jump_Check(void) PORTC &= ~(1 << 7); #endif + #if ((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) { // cppcheck-suppress constStatement