AP_Baro: Fix timestamp wrapping

This commit is contained in:
murata 2020-04-14 00:49:02 +09:00 committed by Randy Mackay
parent dd3373a489
commit 5b9fc1b146
1 changed files with 2 additions and 2 deletions

View File

@ -318,7 +318,7 @@ bool AP_Baro_BMP085::_data_ready()
// No EOC pin: use time from last read instead. // No EOC pin: use time from last read instead.
if (_state == 0) { if (_state == 0) {
return AP_HAL::millis() > _last_temp_read_command_time + 5; return AP_HAL::millis() - _last_temp_read_command_time > 5u;
} }
uint32_t conversion_time_msec; uint32_t conversion_time_msec;
@ -339,5 +339,5 @@ bool AP_Baro_BMP085::_data_ready()
break; break;
} }
return AP_HAL::millis() > _last_press_read_command_time + conversion_time_msec; return AP_HAL::millis() - _last_press_read_command_time > conversion_time_msec;
} }