From 80cd99dd884b4628dd67bd5942d7b3c7b6122801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Tue, 9 Jul 2019 22:06:00 +0200 Subject: [PATCH] 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. --- src/modules/land_detector/LandDetector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/land_detector/LandDetector.cpp b/src/modules/land_detector/LandDetector.cpp index 579ed3224e5b..e597eac039f3 100644 --- a/src/modules/land_detector/LandDetector.cpp +++ b/src/modules/land_detector/LandDetector.cpp @@ -190,7 +190,7 @@ void LandDetector::_update_state() void LandDetector::_update_total_flight_time() { _total_flight_time = static_cast(_param_total_flight_time_high.get()) << 32; - _total_flight_time |= _param_total_flight_time_low.get(); + _total_flight_time |= static_cast(_param_total_flight_time_low.get()); } } // namespace land_detector