beep, cmd, config, convert_volt, data, distance, fec, kalman: -Wconversion warnings
[fw/altos] / src / kernel / ao_kalman.c
index 168812b750aa70c03eeca94fa3a8cd6b20378e62..cdf64bec9052e106fa43cabdbb3015955c9645d2 100644 (file)
@@ -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
@@ -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);
 }