@@ 44,17 44,19 @@
static void __attribute__((noreturn)) stop_system(void)
{
- if (dumpLogs() != 1) {
- LOG_ERROR("Cannot dump logs");
- }
-
- const auto err = purefs::subsystem::unmount_all();
- if(err) {
- LOG_WARN("Unable unmount all filesystems with error: %i.", err);
- } else {
- LOG_INFO("Filesystems unmounted successfully...");
+ if(!isIRQ()) {
+ if (dumpLogs() != 1) {
+ LOG_ERROR("Cannot dump logs");
+ }
+ const auto err = purefs::subsystem::unmount_all();
+ if(err) {
+ LOG_WARN("Unable unmount all filesystems with error: %i.", err);
+ } else {
+ LOG_INFO("Filesystems unmounted successfully...");
+ }
}
LOG_INFO("Restarting the system...");
+ haltIfDebugging();
vTaskEndScheduler();
NVIC_SystemReset();
// waiting for system reset
@@ 68,7 70,7 @@ static void __attribute__((noreturn)) stop_system(void)
void __attribute__((noreturn, used)) _exit_backtrace(int code, bool bt_dump)
{
LOG_INFO("_exit %d", code);
- if( bt_dump ) {
+ if( bt_dump && !isIRQ() ) {
_StackTrace_Dump_And_Abort();
}
stop_system();