From 885fc79af55bd7b3e14145f62fb7b7fabdc5667d Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Mon, 17 Dec 2012 16:28:22 -0800 Subject: [PATCH] AP_HAL_Empty: add panic method to scheduler --- libraries/AP_HAL_Empty/Scheduler.cpp | 7 +++++++ libraries/AP_HAL_Empty/Scheduler.h | 1 + 2 files changed, 8 insertions(+) diff --git a/libraries/AP_HAL_Empty/Scheduler.cpp b/libraries/AP_HAL_Empty/Scheduler.cpp index 1dcdaa1a30..0698a3b3de 100644 --- a/libraries/AP_HAL_Empty/Scheduler.cpp +++ b/libraries/AP_HAL_Empty/Scheduler.cpp @@ -3,6 +3,8 @@ using namespace Empty; +extern const AP_HAL::HAL& hal; + EmptyScheduler::EmptyScheduler() {} @@ -51,6 +53,11 @@ void EmptyScheduler::begin_atomic() void EmptyScheduler::end_atomic() {} +void EmptyScheduler::panic(const prog_char_t *errormsg) { + hal.console->println_P(errormsg); + for(;;); +} + void EmptyScheduler::reboot() { for(;;); } diff --git a/libraries/AP_HAL_Empty/Scheduler.h b/libraries/AP_HAL_Empty/Scheduler.h index fc1b3cd53f..e64a4d7c52 100644 --- a/libraries/AP_HAL_Empty/Scheduler.h +++ b/libraries/AP_HAL_Empty/Scheduler.h @@ -24,6 +24,7 @@ public: void begin_atomic(); void end_atomic(); + void panic(const prog_char_t *errormsg); void reboot(); };