From dcc17dad94f6122e2309ba60a97c4c82ead52bcb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 18 Dec 2012 13:42:38 +1100 Subject: [PATCH] SITL: added panic() method in scheduler --- libraries/AP_HAL_AVR_SITL/Scheduler.cpp | 5 +++++ libraries/AP_HAL_AVR_SITL/Scheduler.h | 1 + 2 files changed, 6 insertions(+) diff --git a/libraries/AP_HAL_AVR_SITL/Scheduler.cpp b/libraries/AP_HAL_AVR_SITL/Scheduler.cpp index e8358a986a..4b3cf923bf 100644 --- a/libraries/AP_HAL_AVR_SITL/Scheduler.cpp +++ b/libraries/AP_HAL_AVR_SITL/Scheduler.cpp @@ -192,4 +192,9 @@ void SITLScheduler::timer_event() _in_timer_proc = false; } +void SITLScheduler::panic(const prog_char_t *errormsg) { + hal.console->println_P(errormsg); + for(;;); +} + #endif diff --git a/libraries/AP_HAL_AVR_SITL/Scheduler.h b/libraries/AP_HAL_AVR_SITL/Scheduler.h index fc3542eab3..755e513ed9 100644 --- a/libraries/AP_HAL_AVR_SITL/Scheduler.h +++ b/libraries/AP_HAL_AVR_SITL/Scheduler.h @@ -29,6 +29,7 @@ public: void begin_atomic(); void end_atomic(); void reboot(); + void panic(const prog_char_t *errormsg); bool interrupts_are_blocked(void) { return _nested_atomic_ctr != 0; }