AP_HAL_Empty: Scheduler: implement variadic version of panic()

This commit is contained in:
Lucas De Marchi 2015-10-22 15:15:05 -02:00 committed by Andrew Tridgell
parent 6027a02fe9
commit e2d1fab863

View File

@ -1,6 +1,8 @@
#include "Scheduler.h"
#include <stdarg.h>
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(;;);
}