mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
AEROCORE Moved magic numbers for battery V div and A per V to board_config.h
This commit is contained in:
parent
f86a8c0e5e
commit
894b41e313
@ -120,6 +120,12 @@
|
||||
#define ADC_BATTERY_CURRENT_CHANNEL ((uint8_t)(-1))
|
||||
#define ADC_AIRSPEED_VOLTAGE_CHANNEL ((uint8_t)(-1))
|
||||
|
||||
/* Define Battery 1 Voltage Divider and A per V
|
||||
*/
|
||||
|
||||
#define BOARD_BATTERY1_V_DIV (7.8196363636f)
|
||||
#define BOARD_BATTERY1_A_PER_V (15.391030303f)
|
||||
|
||||
/* PWM
|
||||
*
|
||||
* Eight PWM outputs are configured.
|
||||
|
||||
@ -419,9 +419,7 @@ int update_parameters(const ParameterHandles ¶meter_handles, Parameters &par
|
||||
|
||||
parameters.battery_v_div = BOARD_BATTERY1_V_DIV;
|
||||
|
||||
#if defined (CONFIG_ARCH_BOARD_AEROCORE)
|
||||
parameters.battery_v_div = 7.8196363636f;
|
||||
#elif defined (CONFIG_ARCH_BOARD_PX4FMU_V1)
|
||||
#if defined (CONFIG_ARCH_BOARD_PX4FMU_V1)
|
||||
parameters.battery_v_div = 5.7013919372f;
|
||||
#endif
|
||||
param_set(parameter_handles.battery_v_div, ¶meters.battery_v_div);
|
||||
@ -436,7 +434,7 @@ int update_parameters(const ParameterHandles ¶meter_handles, Parameters &par
|
||||
|
||||
parameters.battery_a_per_v = BOARD_BATTERY1_A_PER_V;
|
||||
|
||||
#if defined (CONFIG_ARCH_BOARD_AEROCORE) || defined (CONFIG_ARCH_BOARD_PX4FMU_V1)
|
||||
#if defined (CONFIG_ARCH_BOARD_PX4FMU_V1)
|
||||
/* current scaling for 3DR power brick */
|
||||
parameters.battery_a_per_v = 15.391030303f;
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user