AP_HAL_VRBRAIN: Scheduler: implement variadic version of panic()

This commit is contained in:
Lucas De Marchi 2015-10-22 15:15:06 -02:00 committed by Andrew Tridgell
parent f791767fb2
commit e9d92c446c

View File

@ -327,8 +327,13 @@ void *VRBRAINScheduler::_io_thread(void)
void VRBRAINScheduler::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.scheduler->delay_microseconds(10000);
_vrbrain_thread_should_exit = true;
exit(1);