Skip to content

Commit

Permalink
Avoid false timeout on timer overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pembem22 committed Jan 19, 2025
1 parent ebf4366 commit f4c2835
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sensors/softfusion/softfusionsensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class SoftFusionSensor : public Sensor {
void checkSensorTimeout() {
uint32_t now = micros();
constexpr uint32_t sensorTimeoutMicros = 2e6; // 2 seconds
if (m_lastRotationUpdate + sensorTimeoutMicros > now) {
if (now - m_lastRotationUpdate < sensorTimeoutMicros) {
return;
}

Expand Down

0 comments on commit f4c2835

Please sign in to comment.