Skip to content

Commit

Permalink
AP_DroneCAN: prevent saturation of CPU with DroneCAN thread
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Sep 26, 2024
1 parent d63862c commit ea395a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/AP_DroneCAN/AP_DroneCAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,10 @@ void AP_DroneCAN::loop(void)
continue;
}

// ensure that the DroneCAN thread cannot completely saturate
// the CPU, preventing low priority threads from running
hal.scheduler->delay_microseconds(100);

canard_iface.process(1);

safety_state_send();
Expand Down

0 comments on commit ea395a6

Please sign in to comment.