aboutsummaryrefslogtreecommitdiff
path: root/src/modules/fw_att_pos_estimator
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-02-23 19:05:32 -0800
committerLorenz Meier <lm@inf.ethz.ch>2014-02-23 19:05:32 -0800
commit76ac14d3c4e44c22b04b312acfa34186dfb028d0 (patch)
tree1941c084d49dbce12cd3477acafbd6819f47486c /src/modules/fw_att_pos_estimator
parentb4c1713b96d452efa8c2285537f0969d1e6dcb77 (diff)
downloadpx4-firmware-76ac14d3c4e44c22b04b312acfa34186dfb028d0.tar.gz
px4-firmware-76ac14d3c4e44c22b04b312acfa34186dfb028d0.tar.bz2
px4-firmware-76ac14d3c4e44c22b04b312acfa34186dfb028d0.zip
Use right combination of casts
Diffstat (limited to 'src/modules/fw_att_pos_estimator')
-rw-r--r--src/modules/fw_att_pos_estimator/estimator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/fw_att_pos_estimator/estimator.cpp b/src/modules/fw_att_pos_estimator/estimator.cpp
index e449a6602..c9e809280 100644
--- a/src/modules/fw_att_pos_estimator/estimator.cpp
+++ b/src/modules/fw_att_pos_estimator/estimator.cpp
@@ -1617,11 +1617,11 @@ void StoreStates(uint64_t timestamp_ms)
// Output the state vector stored at the time that best matches that specified by msec
void RecallStates(float (&statesForFusion)[n_states], uint64_t msec)
{
- long int bestTimeDelta = 200;
+ int64_t bestTimeDelta = 200;
unsigned bestStoreIndex = 0;
for (unsigned storeIndex = 0; storeIndex < data_buffer_size; storeIndex++)
{
- int64_t timeDelta = (int64_t)msec - statetimeStamp[storeIndex];
+ int64_t timeDelta = (int)msec - statetimeStamp[storeIndex];
if (timeDelta < 0) timeDelta = -timeDelta;
if (timeDelta < bestTimeDelta)
{