Browse Source

AP_HAL_Linux: Scheduler: move rpcmem initialization to setup phase

This was the only piece remaining in the timer thread that was used only
to setup the thread.
master
Lucas De Marchi 9 years ago
parent
commit
860d5aaf84
  1. 13
      libraries/AP_HAL_Linux/Scheduler.cpp

13
libraries/AP_HAL_Linux/Scheduler.cpp

@ -280,11 +280,6 @@ void Scheduler::_run_timers()
void Scheduler::_timer_task() void Scheduler::_timer_task()
{ {
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_QFLIGHT
printf("Initialising rpcmem\n");
rpcmem_init();
#endif
/* /*
this aims to run at an average of 1kHz, so that it can be used this aims to run at an average of 1kHz, so that it can be used
to drive 1kHz processes without drift to drive 1kHz processes without drift
@ -431,6 +426,14 @@ void Scheduler::stop_clock(uint64_t time_usec)
bool Scheduler::SchedulerThread::_run() bool Scheduler::SchedulerThread::_run()
{ {
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_QFLIGHT
if (_sched._timer_thread.is_current_thread()) {
/* make rpcmem initialization on timer thread */
printf("Initialising rpcmem\n");
rpcmem_init();
}
#endif
_sched._wait_all_threads(); _sched._wait_all_threads();
return Thread::_run(); return Thread::_run();

Loading…
Cancel
Save