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
|
// Values for PERSISTENT_OBJECT_RESET_REASON
|
||||||
#define RESET_NONE 0
|
#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_BOOTLOADER_POST 2 // Reset after boot loader activity
|
||||||
#define RESET_MSC_REQUEST 3 // MSC invocation was requested
|
#define RESET_MSC_REQUEST 3 // MSC invocation was requested
|
||||||
#define RESET_FORCED 4 // Reset due to unknown reset reason
|
#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);
|
void persistentObjectInit(void);
|
||||||
uint32_t persistentObjectRead(persistentObjectId_e id);
|
uint32_t persistentObjectRead(persistentObjectId_e id);
|
||||||
|
|
|
@ -44,7 +44,7 @@ void systemResetToBootloader(bootloaderRequestType_e requestType)
|
||||||
switch (requestType) {
|
switch (requestType) {
|
||||||
case BOOTLOADER_REQUEST_ROM:
|
case BOOTLOADER_REQUEST_ROM:
|
||||||
default:
|
default:
|
||||||
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST);
|
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST_ROM);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ void checkForBootLoaderRequest(void)
|
||||||
{
|
{
|
||||||
uint32_t bootloaderRequest = persistentObjectRead(PERSISTENT_OBJECT_RESET_REASON);
|
uint32_t bootloaderRequest = persistentObjectRead(PERSISTENT_OBJECT_RESET_REASON);
|
||||||
|
|
||||||
if (bootloaderRequest != RESET_BOOTLOADER_REQUEST) {
|
if (bootloaderRequest != RESET_BOOTLOADER_REQUEST_ROM) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_NONE);
|
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_NONE);
|
||||||
|
|
|
@ -52,7 +52,7 @@ void systemResetToBootloader(bootloaderRequestType_e requestType)
|
||||||
switch (requestType) {
|
switch (requestType) {
|
||||||
case BOOTLOADER_REQUEST_ROM:
|
case BOOTLOADER_REQUEST_ROM:
|
||||||
default:
|
default:
|
||||||
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST);
|
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST_ROM);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ static void checkForBootLoaderRequest(void)
|
||||||
{
|
{
|
||||||
uint32_t bootloaderRequest = persistentObjectRead(PERSISTENT_OBJECT_RESET_REASON);
|
uint32_t bootloaderRequest = persistentObjectRead(PERSISTENT_OBJECT_RESET_REASON);
|
||||||
|
|
||||||
if (bootloaderRequest != RESET_BOOTLOADER_REQUEST) {
|
if (bootloaderRequest != RESET_BOOTLOADER_REQUEST_ROM) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_NONE);
|
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_NONE);
|
||||||
|
|
|
@ -250,13 +250,13 @@ void systemResetToBootloader(bootloaderRequestType_e requestType)
|
||||||
switch (requestType) {
|
switch (requestType) {
|
||||||
#if defined(USE_FLASH_BOOT_LOADER)
|
#if defined(USE_FLASH_BOOT_LOADER)
|
||||||
case BOOTLOADER_REQUEST_FLASH:
|
case BOOTLOADER_REQUEST_FLASH:
|
||||||
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_FLASH_BOOTLOADER_REQUEST);
|
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST_FLASH);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case BOOTLOADER_REQUEST_ROM:
|
case BOOTLOADER_REQUEST_ROM:
|
||||||
default:
|
default:
|
||||||
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST);
|
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_REQUEST_ROM);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -273,9 +273,9 @@ void systemCheckResetReason(void)
|
||||||
|
|
||||||
switch (bootloaderRequest) {
|
switch (bootloaderRequest) {
|
||||||
#if defined(USE_FLASH_BOOT_LOADER)
|
#if defined(USE_FLASH_BOOT_LOADER)
|
||||||
case BOOTLOADER_REQUEST_FLASH:
|
case RESET_BOOTLOADER_REQUEST_FLASH:
|
||||||
#endif
|
#endif
|
||||||
case RESET_BOOTLOADER_REQUEST:
|
case RESET_BOOTLOADER_REQUEST_ROM:
|
||||||
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_POST);
|
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_POST);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -281,7 +281,7 @@ static void mspRebootFn(serialPort_t *serialPort)
|
||||||
#endif
|
#endif
|
||||||
#if defined(USE_FLASH_BOOT_LOADER)
|
#if defined(USE_FLASH_BOOT_LOADER)
|
||||||
case MSP_REBOOT_BOOTLOADER_FLASH:
|
case MSP_REBOOT_BOOTLOADER_FLASH:
|
||||||
systemResetToBootloader(BOOTLOADER_REQUEST_FLASH);
|
systemResetToBootloader(BOATLOADER_REQUEST_FLASH);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -451,8 +451,8 @@ static void mspProcessPendingRequest(mspPort_t * mspPort)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
#if defined(USE_FLASH_BOOT_LOADER)
|
#if defined(USE_FLASH_BOOT_LOADER)
|
||||||
case MSP_PENDING_BOOTLOADER_ROM:
|
case MSP_PENDING_BOOTLOADER_FLASH:
|
||||||
systemResetToBootloader(BOOTLOADER_REQUEST_FLASH);
|
systemResetToBootloader(BOATLOADER_REQUEST_FLASH);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue