1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-13 11:29:51 +03:00

MAGIC value for powerReason should be stored in RTC backup on Horus (#7096)

- Allows the radio main application to start correctly when coming from an app in RAM
- Refactoring of the `UNEXPECTED_SHUTDOWN()` process
- Saves the RTC battery as BACKUP RAM is not needed on normal shutdown
- On PWR OFF on an ALERT, the radio won't show the next alert before shutting down
- Bootloader flashable through the SD Manager
This commit is contained in:
Bertrand Songis 2019-11-21 11:50:33 +01:00 committed by GitHub
parent 103534bdcf
commit 4cdd17f0d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 235 additions and 190 deletions

View file

@ -195,7 +195,7 @@ int main()
FRESULT fr;
uint32_t nameCount = 0;
wdt_reset();
WDG_RESET();
RCC_AHB1PeriphClockCmd(PWR_RCC_AHB1Periph | KEYS_RCC_AHB1Periph |
LCD_RCC_AHB1Periph | BACKLIGHT_RCC_AHB1Periph |
@ -215,7 +215,7 @@ int main()
#if defined(PCBHORUS)
// wait a bit for the inputs to stabilize...
for (uint32_t i = 0; i < 50000; i++) {
wdt_reset();
WDG_RESET();
}
#endif
@ -265,12 +265,12 @@ int main()
#if defined(PWR_BUTTON_PRESS)
// wait until power button is released
while (pwrPressed()) {
wdt_reset();
WDG_RESET();
}
#endif
for (;;) {
wdt_reset();
WDG_RESET();
if (tenms) {
tenms = 0;
@ -506,16 +506,12 @@ int main()
lcdRefresh();
lcdRefreshWait();
#if !defined(EEPROM)
// Use jump on radios with emergency mode
// to avoid triggering it with a soft reset
// Jump to proper application address
jumpTo(APP_START_ADDRESS);
#else
// Use software reset everywhere else
NVIC_SystemReset();
#if defined(RTC_BACKUP_RAM)
rtcInit();
RTC->BKP0R = SOFTRESET_REQUEST;
#endif
NVIC_SystemReset();
}
}
@ -523,5 +519,5 @@ int main()
}
#if defined(PCBHORUS)
void *__dso_handle = 0;
void *__dso_handle = nullptr;
#endif