mirror of https://github.com/ArduPilot/ardupilot
SITL: fix labs on unsigned value subtraction
This commit is contained in:
parent
2e41077347
commit
643fc77323
|
@ -125,7 +125,7 @@ uint32_t SITL::TSYS01::calculate_adc(float temperature) const
|
|||
|
||||
// temperature_for_adc(9378708); // should be 10.59
|
||||
|
||||
while (labs(max_adc - min_adc) > 1 && current_error > 0.05) {
|
||||
while (labs(int32_t(max_adc - min_adc)) > 1 && current_error > 0.05) {
|
||||
uint32_t candidate_adc;
|
||||
if (bisect_down) {
|
||||
candidate_adc = (min_adc+(uint64_t)current_adc)/2;
|
||||
|
|
Loading…
Reference in New Issue