File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,23 @@ void Scheduler::delay_microseconds(uint16_t usec)
136
136
} while (true );
137
137
}
138
138
139
+ /*
140
+ delay from AP_InertialSensor wait for IMU sample
141
+ */
142
+ void Scheduler::delay_microseconds_boost (uint16_t usec)
143
+ {
144
+ if (in_main_thread () && !hal.util ->get_soft_armed () && usec >= 500 ) {
145
+ const uint32_t start_us = AP_HAL::micros ();
146
+ call_delay_cb ();
147
+ const uint32_t dt_us = AP_HAL::micros () - start_us;
148
+ if (dt_us >= usec) {
149
+ return ;
150
+ }
151
+ usec -= dt_us;
152
+ }
153
+ delay_microseconds (usec);
154
+ }
155
+
139
156
void Scheduler::delay (uint16_t ms)
140
157
{
141
158
uint32_t start = AP_HAL::millis ();
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ class HALSITL::Scheduler : public AP_HAL::Scheduler {
21
21
void init () override ;
22
22
void delay (uint16_t ms) override ;
23
23
void delay_microseconds (uint16_t us) override ;
24
+ void delay_microseconds_boost (uint16_t us) override ;
24
25
25
26
void register_timer_process (AP_HAL::MemberProc) override ;
26
27
void register_io_process (AP_HAL::MemberProc) override ;
You can’t perform that action at this time.
0 commit comments