mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
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:
@@ -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).
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user