AP_HAL_Linux: 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 ad61a93c14
commit 2af4244854
1 changed files with 6 additions and 1 deletions

View File

@ -409,8 +409,13 @@ void *Scheduler::_io_thread(void* arg)
void Scheduler::panic(const prog_char_t *errormsg, ...)
{
write(1, errormsg, strlen(errormsg));
va_list ap;
va_start(ap, errormsg);
vdprintf(1, errormsg, ap);
va_end(ap);
write(1, "\n", 1);
hal.rcin->deinit();
hal.scheduler->delay_microseconds(10000);
exit(1);