feat(diags): Red LED before RTC data, blue LED after (#3006)

* Added turning the red LED before RTC data and blue LED afterwards

With the LED turned RED if the RTC data retrieval fails it will stay red.
This will at least be an indication that the RTC startup encountered
a problem. For now there is no indication that this problem occurred.

* GH-3005 Moved LED manipulation to conditionally compiled when RTC operation happens
This commit is contained in:
Matthias Hryniszak
2023-01-15 12:02:03 +10:00
committed by GitHub
parent 8ee73a5800
commit a68c0cf58a
+6 -5
View File
@@ -236,11 +236,12 @@ void boardInit()
sportUpdateInit();
#endif
ledBlue();
#if defined(RTCLOCK) && !defined(COPROCESSOR)
ledRed();
rtcInit(); // RTC must be initialized before rambackupRestore() is called
#endif
ledBlue();
}
void boardOff()
@@ -276,8 +277,8 @@ void boardOff()
RTC->BKP0R = SHUTDOWN_REQUEST;
pwrOff();
// We reach here only in forced power situations, such as hw-debugging with external power
// We reach here only in forced power situations, such as hw-debugging with external power
// Enter STM32 stop mode / deep-sleep
// Code snippet from ST Nucleo PWR_EnterStopMode example
#define PDMode 0x00000000U
@@ -291,7 +292,7 @@ void boardOff()
/* Set SLEEPDEEP bit of Cortex System Control Register */
SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));
// To avoid HardFault at return address, end in an endless loop
while (1) {