1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 09:45:37 +03:00

Changed float parameters to int16 in 'cli.c'.

Fixed buffer length used for 'ftoa'.

Got rid of magic numbers, replaced 'digitalIdlePercent' with 'digitalIdleValue'.
This commit is contained in:
Michael Keller 2017-03-30 12:12:20 +13:00
parent ce8c5fbd79
commit 9c29475ba4
16 changed files with 77 additions and 120 deletions

View file

@ -49,9 +49,9 @@ PG_REGISTER_WITH_RESET_TEMPLATE(barometerConfig_t, barometerConfig, PG_BAROMETER
PG_RESET_TEMPLATE(barometerConfig_t, barometerConfig,
.baro_hardware = 1,
.baro_sample_count = 21,
.baro_noise_lpf = 0.6f,
.baro_cf_vel = 0.985f,
.baro_cf_alt = 0.965f
.baro_noise_lpf = 600,
.baro_cf_vel = 985,
.baro_cf_alt = 965
);
#ifdef BARO
@ -229,7 +229,7 @@ int32_t baroCalculateAltitude(void)
if (isBaroCalibrationComplete()) {
BaroAlt_tmp = lrintf((1.0f - powf((float)(baroPressureSum / PRESSURE_SAMPLE_COUNT) / 101325.0f, 0.190295f)) * 4433000.0f); // in cm
BaroAlt_tmp -= baroGroundAltitude;
baro.BaroAlt = lrintf((float)baro.BaroAlt * barometerConfig()->baro_noise_lpf + (float)BaroAlt_tmp * (1.0f - barometerConfig()->baro_noise_lpf)); // additional LPF to reduce baro noise
baro.BaroAlt = lrintf((float)baro.BaroAlt * CONVERT_PARAMETER_TO_FLOAT(barometerConfig()->baro_noise_lpf) + (float)BaroAlt_tmp * (1.0f - CONVERT_PARAMETER_TO_FLOAT(barometerConfig()->baro_noise_lpf))); // additional LPF to reduce baro noise
}
else {
baro.BaroAlt = 0;