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

@@ -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;
}