system_api: call shutdown handlers in reverse order
Similar to how destructors should be called in reverse order to the constructors.
This commit is contained in:
parent
2f38a1a362
commit
f0563b3844
1 changed files with 5 additions and 6 deletions
|
@ -230,12 +230,11 @@ void esp_restart_noos(void) __attribute__ ((noreturn));
|
||||||
|
|
||||||
void IRAM_ATTR esp_restart(void)
|
void IRAM_ATTR esp_restart(void)
|
||||||
{
|
{
|
||||||
int i;
|
for (int i = SHUTDOWN_HANDLERS_NO - 1; i >= 0; i--) {
|
||||||
for (i = 0; i < SHUTDOWN_HANDLERS_NO; i++) {
|
if (shutdown_handlers[i]) {
|
||||||
if (shutdown_handlers[i]) {
|
shutdown_handlers[i]();
|
||||||
shutdown_handlers[i]();
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Disable scheduler on this core.
|
// Disable scheduler on this core.
|
||||||
vTaskSuspendAll();
|
vTaskSuspendAll();
|
||||||
|
|
Loading…
Reference in a new issue