void *Scheduler::_timer_thread(void *arg) { Scheduler *sched = (Scheduler *)arg; uint32_t last_ran_overtime = 0; while (!sched->_hal_initialized) { sched->delay_microseconds(1000); } while (true) { sched->delay_microseconds(1000); // run registered timers sched->_run_timers(true); // process any pending RC output requests ((RCOutput *)hal.rcout)->timer_update(); if (qurt_ran_overtime && AP_HAL::millis() - last_ran_overtime > 2000) { last_ran_overtime = AP_HAL::millis(); printf("Overtime in task %d\n", (int)AP_Scheduler::current_task); hal.console->printf("Overtime in task %d\n", (int)AP_Scheduler::current_task); } } return nullptr; }
void Scheduler::_timer_thread(void *arg) { Scheduler *sched = (Scheduler *)arg; chRegSetThreadName("apm_timer"); while (!sched->_hal_initialized) { sched->delay_microseconds(1000); } while (true) { sched->delay_microseconds(1000); // run registered timers sched->_run_timers(); // process any pending RC output requests hal.rcout->timer_tick(); } }
void Scheduler::_timer_thread(void *arg) { Scheduler *sched = (Scheduler *)arg; sched->_timer_thread_ctx->name = "apm_timer"; while (!sched->_hal_initialized) { sched->delay_microseconds(1000); } while (true) { sched->delay_microseconds(1000); // run registered timers sched->_run_timers(true); // process any pending RC output requests //hal.rcout->timer_tick(); // process any pending RC input requests ((RCInput *)hal.rcin)->_timer_tick(); } }