1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

Add booting into the flash boot loader as an option.

This commit is contained in:
mikeller 2019-06-15 19:47:47 +12:00
parent de60402840
commit 5cf42f40b6
14 changed files with 180 additions and 111 deletions

View file

@ -39,9 +39,15 @@ void systemReset(void)
NVIC_SystemReset();
}
void systemResetToBootloader(void)
void systemResetToBootloader(bootloaderRequestType_e requestType)
{
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST);
switch (requestType) {
case BOOTLOADER_REQUEST_ROM:
default:
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST);
break;
}
__disable_irq();
NVIC_SystemReset();
@ -54,6 +60,7 @@ typedef struct isrVector_s {
resetHandler_t *resetHandler;
} isrVector_t;
// Used in the startup files for F4
void checkForBootLoaderRequest(void)
{
uint32_t bootloaderRequest = persistentObjectRead(PERSISTENT_OBJECT_RESET_REASON);