From 73c77d0757991287b8cee307d0624d2a04062f84 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Sat, 12 Aug 2023 00:08:02 +0100 Subject: [PATCH] AP_BattMonitor: expose CAPACITY param on periph --- libraries/AP_BattMonitor/AP_BattMonitor_Params.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/AP_BattMonitor/AP_BattMonitor_Params.cpp b/libraries/AP_BattMonitor/AP_BattMonitor_Params.cpp index 00a5de0c80..01ec3bbded 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor_Params.cpp +++ b/libraries/AP_BattMonitor/AP_BattMonitor_Params.cpp @@ -9,6 +9,10 @@ #define DEFAULT_LOW_BATTERY_VOLTAGE 0.0f #endif // APM_BUILD_COPTER_OR_HELI +#ifndef AP_BATT_MONITOR_BATTERY_CAPACITY + #define AP_BATT_MONITOR_BATTERY_CAPACITY 3300 +#endif + const AP_Param::GroupInfo AP_BattMonitor_Params::var_info[] = { // @Param: MONITOR // @DisplayName: Battery monitoring @@ -28,15 +32,15 @@ const AP_Param::GroupInfo AP_BattMonitor_Params::var_info[] = { // 6 was AMP_OFFSET -#ifndef HAL_BUILD_AP_PERIPH // @Param: CAPACITY // @DisplayName: Battery capacity // @Description: Capacity of the battery in mAh when full // @Units: mAh // @Increment: 50 // @User: Standard - AP_GROUPINFO("CAPACITY", 7, AP_BattMonitor_Params, _pack_capacity, 3300), + AP_GROUPINFO("CAPACITY", 7, AP_BattMonitor_Params, _pack_capacity, AP_BATT_MONITOR_BATTERY_CAPACITY), +#ifndef HAL_BUILD_AP_PERIPH // @Param{Plane}: WATT_MAX // @DisplayName: Maximum allowed power (Watts) // @Description: If battery wattage (voltage * current) exceeds this value then the system will reduce max throttle (THR_MAX, TKOFF_THR_MAX and THR_MIN for reverse thrust) to satisfy this limit. This helps limit high current to low C rated batteries regardless of battery voltage. The max throttle will slowly grow back to THR_MAX (or TKOFF_THR_MAX ) and THR_MIN if demanding the current max and under the watt max. Use 0 to disable.