AP_HAL_SITL: correct I2C callback interval

This commit is contained in:
Peter Barker 2021-01-03 23:32:23 +11:00 committed by Peter Barker
parent 324ff178d8
commit 3c16f164df
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ void I2CBus::_timer_tick()
{
const uint64_t now = AP_HAL::micros64();
for (struct callback_info *ci = callbacks; ci != nullptr; ci = ci->next) {
if (ci->next_usec >= now) {
if (ci->next_usec < now) {
WITH_SEMAPHORE(sem);
ci->cb();
ci->next_usec += ci->period_usec;