bootloader: add legacy DFU force method

This commit is contained in:
King Kévin 2020-01-02 13:00:49 +01:00
parent b42d704435
commit 55b30588ed
1 changed files with 2 additions and 0 deletions

View File

@ -44,6 +44,8 @@ void main(void)
__dfu_magic[1] = 0;
__dfu_magic[2] = 0;
__dfu_magic[3] = 0;
} else if (0 == (RCC_CSR & 0xfc000000)) { // no reset flag present -> this was a soft reset using scb_reset_core() after clearing the flags using RCC_CSR_RMVF, this was the legacy way to start the DFU mode
dfu_force = true;
} else { // check if the force DFU mode input is set
// disable SWJ pin to use as GPIO
#if (GPIO(B) == GPIO_PORT(DFU_FORCE_PIN)) && (GPIO(4) == GPIO_PIN(DFU_FORCE_PIN))