File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -139,9 +139,10 @@ class Service : public ServiceIo {
139139 void heartbeat ();
140140
141141 void runProcessing ();
142- virtual void OnLoop (uint32_t now_micros, uint32_t last_tick_micros) {
142+ virtual uint32_t OnLoop (uint32_t now_micros, uint32_t last_tick_micros) {
143143 (void )now_micros;
144144 (void )last_tick_micros;
145+ return UINT32_MAX;
145146 };
146147
147148 void HandleClaimMessage (datatypes::XbotHeader *header, const void *payload, size_t payload_len);
Original file line number Diff line number Diff line change @@ -217,8 +217,9 @@ void xbot::service::Service::runProcessing() {
217217
218218 // Run schedules.
219219 uint32_t now_micros = system::getTimeMicros ();
220- OnLoop (now_micros, last_tick_micros);
221- uint32_t block_time = scheduler_.Tick (now_micros - last_tick_micros);
220+ uint32_t on_loop_block_time = OnLoop (now_micros, last_tick_micros);
221+ uint32_t scheduler_block_time = scheduler_.Tick (now_micros - last_tick_micros);
222+ uint32_t block_time = on_loop_block_time < scheduler_block_time ? on_loop_block_time : scheduler_block_time;
222223 if (block_time > 1'000'000 ) {
223224 block_time = 1'000'000 ;
224225 }
You can’t perform that action at this time.
0 commit comments