APM:Libraries
Scheduler.cpp
Go to the documentation of this file.
1 #include "Scheduler.h"
2 
3 using namespace AP_HAL;
4 
6  uint16_t min_time_ms)
7 {
8  _delay_cb = proc;
9  _min_delay_cb_ms = min_time_ms;
10 }
11 
13 {
14  if (_delay_cb == nullptr) {
15  return;
16  }
17  if (_in_delay_callback) {
18  // don't recurse!
19  return;
20  }
21  _in_delay_callback = true;
22  _delay_cb();
23  _in_delay_callback = false;
24 }
AP_HAL::Proc _delay_cb
Definition: Scheduler.h:92
bool _in_delay_callback
Definition: Scheduler.h:93
virtual void register_delay_callback(AP_HAL::Proc, uint16_t min_time_ms)
Definition: Scheduler.cpp:5
void(* Proc)(void)
virtual void call_delay_cb()
Definition: Scheduler.cpp:12
uint16_t _min_delay_cb_ms
Definition: Scheduler.h:88