|
|
|
@ -230,20 +230,6 @@ void VRBRAINScheduler::register_timer_failsafe(AP_HAL::Proc failsafe, uint32_t p
@@ -230,20 +230,6 @@ void VRBRAINScheduler::register_timer_failsafe(AP_HAL::Proc failsafe, uint32_t p
|
|
|
|
|
_failsafe = failsafe; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void VRBRAINScheduler::suspend_timer_procs() |
|
|
|
|
{ |
|
|
|
|
_timer_suspended = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void VRBRAINScheduler::resume_timer_procs() |
|
|
|
|
{ |
|
|
|
|
_timer_suspended = false; |
|
|
|
|
if (_timer_event_missed == true) { |
|
|
|
|
_run_timers(false); |
|
|
|
|
_timer_event_missed = false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void VRBRAINScheduler::reboot(bool hold_in_bootloader) |
|
|
|
|
{ |
|
|
|
|
// disarm motors to ensure they are off during a bootloader upload
|
|
|
|
@ -256,22 +242,18 @@ void VRBRAINScheduler::reboot(bool hold_in_bootloader)
@@ -256,22 +242,18 @@ void VRBRAINScheduler::reboot(bool hold_in_bootloader)
|
|
|
|
|
px4_systemreset(hold_in_bootloader); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void VRBRAINScheduler::_run_timers(bool called_from_timer_thread) |
|
|
|
|
void VRBRAINScheduler::_run_timers() |
|
|
|
|
{ |
|
|
|
|
if (_in_timer_proc) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
_in_timer_proc = true; |
|
|
|
|
|
|
|
|
|
if (!_timer_suspended) { |
|
|
|
|
// now call the timer based drivers
|
|
|
|
|
for (int i = 0; i < _num_timer_procs; i++) { |
|
|
|
|
if (_timer_proc[i]) { |
|
|
|
|
_timer_proc[i](); |
|
|
|
|
} |
|
|
|
|
// now call the timer based drivers
|
|
|
|
|
for (int i = 0; i < _num_timer_procs; i++) { |
|
|
|
|
if (_timer_proc[i]) { |
|
|
|
|
_timer_proc[i](); |
|
|
|
|
} |
|
|
|
|
} else if (called_from_timer_thread) { |
|
|
|
|
_timer_event_missed = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// and the failsafe, if one is setup
|
|
|
|
@ -302,7 +284,7 @@ void *VRBRAINScheduler::_timer_thread(void *arg)
@@ -302,7 +284,7 @@ void *VRBRAINScheduler::_timer_thread(void *arg)
|
|
|
|
|
|
|
|
|
|
// run registered timers
|
|
|
|
|
perf_begin(sched->_perf_timers); |
|
|
|
|
sched->_run_timers(true); |
|
|
|
|
sched->_run_timers(); |
|
|
|
|
perf_end(sched->_perf_timers); |
|
|
|
|
|
|
|
|
|
// process any pending RC output requests
|
|
|
|
@ -329,12 +311,10 @@ void VRBRAINScheduler::_run_io(void)
@@ -329,12 +311,10 @@ void VRBRAINScheduler::_run_io(void)
|
|
|
|
|
} |
|
|
|
|
_in_io_proc = true; |
|
|
|
|
|
|
|
|
|
if (!_timer_suspended) { |
|
|
|
|
// now call the IO based drivers
|
|
|
|
|
for (int i = 0; i < _num_io_procs; i++) { |
|
|
|
|
if (_io_proc[i]) { |
|
|
|
|
_io_proc[i](); |
|
|
|
|
} |
|
|
|
|
// now call the IO based drivers
|
|
|
|
|
for (int i = 0; i < _num_io_procs; i++) { |
|
|
|
|
if (_io_proc[i]) { |
|
|
|
|
_io_proc[i](); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|