From 81ee7de77611d7256605825fb7594ac4c5cbd7be Mon Sep 17 00:00:00 2001 From: Mitchell Grams Date: Fri, 10 Apr 2026 22:35:11 -0600 Subject: [PATCH] Add code guards to prevent hard crash on $REBOOT for unsupported drivers --- system.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/system.c b/system.c index 83839e7..a9d3580 100644 --- a/system.c +++ b/system.c @@ -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