From e2d1fab863e454eb64b32ee16cf3cc36a1778f7a Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Thu, 22 Oct 2015 15:15:05 -0200 Subject: [PATCH] AP_HAL_Empty: Scheduler: implement variadic version of panic() --- libraries/AP_HAL_Empty/Scheduler.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_Empty/Scheduler.cpp b/libraries/AP_HAL_Empty/Scheduler.cpp index 04a287dc7d..b493cd7bd6 100644 --- a/libraries/AP_HAL_Empty/Scheduler.cpp +++ b/libraries/AP_HAL_Empty/Scheduler.cpp @@ -1,6 +1,8 @@ #include "Scheduler.h" +#include + using namespace Empty; extern const AP_HAL::HAL& hal; @@ -69,8 +71,15 @@ bool EmptyScheduler::system_initializing() { void EmptyScheduler::system_initialized() {} -void EmptyScheduler::panic(const prog_char_t *errormsg, ...) { - hal.console->println_P(errormsg); +void EmptyScheduler::panic(const prog_char_t *errormsg, ...) +{ + va_list ap; + + va_start(ap, errormsg); + hal.console->vprintf_P(errormsg, ap); + va_end(ap); + hal.console->printf_P("\n"); + for(;;); }