diff --git a/src/main/drivers/persistent.h b/src/main/drivers/persistent.h index 4c8939d1f1..656d8f7819 100644 --- a/src/main/drivers/persistent.h +++ b/src/main/drivers/persistent.h @@ -37,11 +37,11 @@ typedef enum { // Values for PERSISTENT_OBJECT_RESET_REASON #define RESET_NONE 0 -#define RESET_BOOTLOADER_REQUEST 1 // Boot loader invocation was requested +#define RESET_BOOTLOADER_REQUEST_ROM 1 // Boot loader invocation was requested #define RESET_BOOTLOADER_POST 2 // Reset after boot loader activity #define RESET_MSC_REQUEST 3 // MSC invocation was requested #define RESET_FORCED 4 // Reset due to unknown reset reason -#define RESET_FLASH_BOOTLOADER_REQUEST 5 +#define RESET_BOOTLOADER_REQUEST_FLASH 5 void persistentObjectInit(void); uint32_t persistentObjectRead(persistentObjectId_e id); diff --git a/src/main/drivers/system_stm32f4xx.c b/src/main/drivers/system_stm32f4xx.c index 1271898b92..017d39f4a9 100644 --- a/src/main/drivers/system_stm32f4xx.c +++ b/src/main/drivers/system_stm32f4xx.c @@ -44,7 +44,7 @@ void systemResetToBootloader(bootloaderRequestType_e requestType) switch (requestType) { case BOOTLOADER_REQUEST_ROM: default: - persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST); + persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST_ROM); break; } @@ -65,7 +65,7 @@ void checkForBootLoaderRequest(void) { uint32_t bootloaderRequest = persistentObjectRead(PERSISTENT_OBJECT_RESET_REASON); - if (bootloaderRequest != RESET_BOOTLOADER_REQUEST) { + if (bootloaderRequest != RESET_BOOTLOADER_REQUEST_ROM) { return; } persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_NONE); diff --git a/src/main/drivers/system_stm32f7xx.c b/src/main/drivers/system_stm32f7xx.c index 0f1d625350..53729877a8 100644 --- a/src/main/drivers/system_stm32f7xx.c +++ b/src/main/drivers/system_stm32f7xx.c @@ -52,7 +52,7 @@ void systemResetToBootloader(bootloaderRequestType_e requestType) switch (requestType) { case BOOTLOADER_REQUEST_ROM: default: - persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST); + persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST_ROM); break; } @@ -167,7 +167,7 @@ static void checkForBootLoaderRequest(void) { uint32_t bootloaderRequest = persistentObjectRead(PERSISTENT_OBJECT_RESET_REASON); - if (bootloaderRequest != RESET_BOOTLOADER_REQUEST) { + if (bootloaderRequest != RESET_BOOTLOADER_REQUEST_ROM) { return; } persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_NONE); diff --git a/src/main/drivers/system_stm32h7xx.c b/src/main/drivers/system_stm32h7xx.c index 7cc35c1b5c..4b18871198 100644 --- a/src/main/drivers/system_stm32h7xx.c +++ b/src/main/drivers/system_stm32h7xx.c @@ -250,13 +250,13 @@ void systemResetToBootloader(bootloaderRequestType_e requestType) switch (requestType) { #if defined(USE_FLASH_BOOT_LOADER) case BOOTLOADER_REQUEST_FLASH: - persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_FLASH_BOOTLOADER_REQUEST); + persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST_FLASH); break; #endif case BOOTLOADER_REQUEST_ROM: default: - persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST); + persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST_ROM); break; } @@ -273,9 +273,9 @@ void systemCheckResetReason(void) switch (bootloaderRequest) { #if defined(USE_FLASH_BOOT_LOADER) - case BOOTLOADER_REQUEST_FLASH: + case RESET_BOOTLOADER_REQUEST_FLASH: #endif - case RESET_BOOTLOADER_REQUEST: + case RESET_BOOTLOADER_REQUEST_ROM: persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_POST); break; diff --git a/src/main/msp/msp.c b/src/main/msp/msp.c index bd48fb9013..73f9451dcf 100644 --- a/src/main/msp/msp.c +++ b/src/main/msp/msp.c @@ -281,7 +281,7 @@ static void mspRebootFn(serialPort_t *serialPort) #endif #if defined(USE_FLASH_BOOT_LOADER) case MSP_REBOOT_BOOTLOADER_FLASH: - systemResetToBootloader(BOOTLOADER_REQUEST_FLASH); + systemResetToBootloader(BOATLOADER_REQUEST_FLASH); break; #endif diff --git a/src/main/msp/msp_serial.c b/src/main/msp/msp_serial.c index 48792cd049..af772cdc1e 100644 --- a/src/main/msp/msp_serial.c +++ b/src/main/msp/msp_serial.c @@ -451,8 +451,8 @@ static void mspProcessPendingRequest(mspPort_t * mspPort) break; #if defined(USE_FLASH_BOOT_LOADER) - case MSP_PENDING_BOOTLOADER_ROM: - systemResetToBootloader(BOOTLOADER_REQUEST_FLASH); + case MSP_PENDING_BOOTLOADER_FLASH: + systemResetToBootloader(BOATLOADER_REQUEST_FLASH); break; #endif