X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fkernel%2Fao_kalman.c;fp=src%2Fkernel%2Fao_kalman.c;h=5f32eb7275de8357d8bb50a80680644dee4817e9;hp=168812b750aa70c03eeca94fa3a8cd6b20378e62;hb=c49bd3cb0c31a51fae79ddc92237cc309be9a242;hpb=d225adc3af9e5726d436cbbdbf8dcc5837e50804 diff --git a/src/kernel/ao_kalman.c b/src/kernel/ao_kalman.c index 168812b7..5f32eb72 100644 --- a/src/kernel/ao_kalman.c +++ b/src/kernel/ao_kalman.c @@ -178,7 +178,7 @@ ao_kalman_err_accel(void) accel = (ao_config.accel_plus_g - ao_sample_accel) * ao_accel_scale; /* Can't use ao_accel here as it is the pre-prediction value still */ - ao_error_a = (accel - ao_k_accel) >> 16; + ao_error_a = (ao_v_t) ((accel - ao_k_accel) >> 16); } #if !defined(FORCE_ACCEL) && HAS_BARO @@ -314,9 +314,9 @@ ao_kalman(void) ao_kalman_correct_accel(); #endif #endif - ao_height = from_fix(ao_k_height); - ao_speed = from_fix(ao_k_speed); - ao_accel = from_fix(ao_k_accel); + ao_height = (ao_v_t) from_fix(ao_k_height); + ao_speed = (ao_v_t) from_fix(ao_k_speed); + ao_accel = (ao_v_t) from_fix(ao_k_accel); if (ao_height > ao_max_height) ao_max_height = ao_height; #if HAS_BARO @@ -331,5 +331,5 @@ ao_kalman(void) ao_avg_height = (ao_avg_height_scaled + 7) >> 4; else #endif - ao_avg_height = (ao_avg_height_scaled + 63) >> 7; + ao_avg_height = (ao_v_t) ((ao_avg_height_scaled + 63) >> 7); }