kopia lustrzana https://github.com/espressif/esp-idf
system_api: call shutdown handlers in reverse order
Similar to how destructors should be called in reverse order to the constructors.pull/4198/head
rodzic
2f38a1a362
commit
f0563b3844
|
@ -230,12 +230,11 @@ void esp_restart_noos(void) __attribute__ ((noreturn));
|
|||
|
||||
void IRAM_ATTR esp_restart(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < SHUTDOWN_HANDLERS_NO; i++) {
|
||||
if (shutdown_handlers[i]) {
|
||||
shutdown_handlers[i]();
|
||||
}
|
||||
}
|
||||
for (int i = SHUTDOWN_HANDLERS_NO - 1; i >= 0; i--) {
|
||||
if (shutdown_handlers[i]) {
|
||||
shutdown_handlers[i]();
|
||||
}
|
||||
}
|
||||
|
||||
// Disable scheduler on this core.
|
||||
vTaskSuspendAll();
|
||||
|
|
Ładowanie…
Reference in New Issue