Fixed FLASH boot loader option. (#8487)
Fixed FLASH boot loader option.
This commit is contained in:
commit
e824b9021b
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue