mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 18:58:52 +08:00
Clipping of the battery current due to Int*Float
Note that Type buf_adc[i].am_data = int32_t, but everything else are floats. Suggest (float)(buf_adc[i].am_data), precisely as was done a few lines later for the voltage.
This commit is contained in:
committed by
Lorenz Meier
parent
60c760280e
commit
38fa6dcad5
@@ -489,7 +489,7 @@ Sensors::adc_poll(struct sensor_combined_s &raw)
|
||||
}
|
||||
|
||||
} else if (ADC_BATTERY_CURRENT_CHANNEL == buf_adc[i].am_channel) {
|
||||
bat_current_a = ((buf_adc[i].am_data * _parameters.battery_current_scaling)
|
||||
bat_current_a = (((float)(buf_adc[i].am_data) * _parameters.battery_current_scaling)
|
||||
- _parameters.battery_current_offset) * _parameters.battery_a_per_v;
|
||||
|
||||
#ifdef ADC_AIRSPEED_VOLTAGE_CHANNEL
|
||||
|
||||
Reference in New Issue
Block a user