Merge pull request #939 from engigeer/PR_reboot_fix

Add code guards to prevent hard crash on $REBOOT for unsupported drivers
This commit is contained in:
Terje Io
2026-04-15 08:41:08 +02:00
committed by GitHub
+6 -4
View File
@@ -787,12 +787,14 @@ FLASHMEM static status_code_t rtc_action (sys_state_t state, char *args)
FLASHMEM static status_code_t reboot_system (sys_state_t state, char *args)
{
report_message("Rebooting controller, communication may be lost", Message_Warning);
hal.delay_ms(100, NULL);
if (hal.reboot) {
report_message("Rebooting controller, communication may be lost", Message_Warning);
hal.delay_ms(100, NULL);
hal.reboot();
hal.reboot();
}
return Status_OK;
return hal.reboot ? Status_OK : Status_InvalidStatement;
}
#ifdef DEBUG