simtrace: Boot into DFU when BOOTLOADER button is pressed

This recovers the old functionality of the SAM7 based OpenPCD firmware.
This commit is contained in:
Harald Welte 2017-11-28 22:29:53 +01:00
parent 27f5fc681c
commit c1e2254854
2 changed files with 15 additions and 0 deletions

View File

@ -61,6 +61,7 @@
#define PINS_USIM1 PIN_PHONE_IO, PIN_PHONE_CLK, PIN_PHONE_CLK_INPUT, PIN_USIM1_VCC, PIN_PHONE_IO_INPUT, PIN_USIM1_nRST
//, VCC_PHONE
#define PIN_BOOTLOADER_SW {PIO_PA31, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}
//** SPI interface **/
/// SPI MISO pin definition (PA12).

View File

@ -35,3 +35,17 @@ void board_main_top(void)
//card_present_init();
#endif
}
int board_override_enter_dfu(void)
{
const Pin bl_sw_pin = PIN_BOOTLOADER_SW;
PIO_Configure(&bl_sw_pin, 1);
/* Enter DFU bootloader in case the respective button is pressed */
if (PIO_Get(&bl_sw_pin) == 0) {
//printf("BOOTLOADER switch presssed -> Force DFU\n\r");
return 1;
} else
return 0;
}