Add code guards to prevent hard crash on $REBOOT for unsupported drivers

This commit is contained in:
Mitchell Grams
2026-04-10 22:35:11 -06:00
parent baabd9d727
commit 81ee7de776
+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