landdetector flight time: fix cast to 64 bits

`_param_total_flight_time_low.get()` is an int32_t and gets sign-extended
if cast directly to uint64_t. To avoid that we first cast to uint32_t.
This commit is contained in:
Beat Küng
2019-07-09 22:06:00 +02:00
committed by Daniel Agar
parent 321c2c0392
commit aa86bf5f92
+1 -1
View File
@@ -190,7 +190,7 @@ void LandDetector::_update_state()
void LandDetector::_update_total_flight_time()
{
_total_flight_time = static_cast<uint64_t>(_param_total_flight_time_high.get()) << 32;
_total_flight_time |= _param_total_flight_time_low.get();
_total_flight_time |= static_cast<uint32_t>(_param_total_flight_time_low.get());
}
} // namespace land_detector