ardupilot/libraries/AP_BattMonitor
Michael du Breuil 946a25fcaa AP_BattMonitor: Handle allocating too many analog channels
If you over allocate the number of analog channels this results in a
crash. It's easy to trigger this if you have voltage only monitors as we
still eat up a current input channel, regarless of if we use it. There
are only 16 channels at this time on ChibiOS, so if you have 9 voltage
only battery monitors you are out.

This PR improves that situation by only allocating channels when needed,
and in the case where we run out we now set a ConfigError, which on a
flight controller is much more friendly then a instant segfault the
moment we read a battery monitor. NOTE: on AP_Periph this takes the
node off the bus, rather then just sitting in the bootloader. This was
consideted acceptable as the current behaviour was to segfault and then
sit in the bootloader, unless you made new firmware that limited the
number of channels allocated it wasn't possible to recover in this
situation anyways.
2024-12-19 13:53:48 -07:00
..
tests AP_BattMonitor: fix missing method declaration compile failure 2023-05-20 17:28:08 +10:00
AP_BattMonitor_AD7091R5.cpp AP_BattMonitor: create table of used backend paramater indices 2024-12-14 15:42:31 +11:00
AP_BattMonitor_AD7091R5.h AP_BattMonitor: Addition of AD7091R5 ADC I2C Read Driver 2023-11-08 18:24:41 +11:00
AP_BattMonitor_Analog.cpp AP_BattMonitor: Handle allocating too many analog channels 2024-12-19 13:53:48 -07:00
AP_BattMonitor_Analog.h AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_Backend.cpp AP_BattMonitor: INA3221: reallocate parameter indices 2024-12-14 15:42:31 +11:00
AP_BattMonitor_Backend.h AP_BattMonitor: add and use AP_BATTERY_ENABLED 2024-02-06 11:01:02 +11:00
AP_BattMonitor_Bebop.cpp AP_BattMonitor: Fix some typos 2023-10-12 18:30:42 +11:00
AP_BattMonitor_Bebop.h AP_BattMonitor: added reset_remaining() API 2019-06-25 09:56:25 +10:00
AP_BattMonitor_config.h AP_BattMonitor: add support for ina3221 triple-channel current/voltage sensor 2024-12-02 10:10:01 -06:00
AP_BattMonitor_DroneCAN.cpp AP_BattMonitor: create table of used backend paramater indices 2024-12-14 15:42:31 +11:00
AP_BattMonitor_DroneCAN.h AP_BattMonitor: optimize DroneCAN subscription process 2024-11-18 10:30:29 +11:00
AP_BattMonitor_EFI.cpp AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_EFI.h AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_ESC.cpp AP_BattMonitor: create table of used backend paramater indices 2024-12-14 15:42:31 +11:00
AP_BattMonitor_ESC.h AP_BattMonitor: ESC: integrate consumed mah if not provided by ESC 2024-07-30 10:59:17 +10:00
AP_BattMonitor_FuelFlow.cpp AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_FuelFlow.h AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_FuelLevel_Analog.cpp AP_BattMonitor: create table of used backend paramater indices 2024-12-14 15:42:31 +11:00
AP_BattMonitor_FuelLevel_Analog.h AP_BattMonitor: FuelLevel_Ananlog: set has_current true so capacity is reported 2024-05-21 10:07:48 +10:00
AP_BattMonitor_FuelLevel_PWM.cpp AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_FuelLevel_PWM.h AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_Generator.cpp AP_BattMonitor: Fix some typos 2023-10-12 18:30:42 +11:00
AP_BattMonitor_Generator.h AP_BattMonitor: Fix some typos 2023-10-12 18:30:42 +11:00
AP_BattMonitor_INA2xx.cpp AP_BattMonitor: create table of used backend paramater indices 2024-12-14 15:42:31 +11:00
AP_BattMonitor_INA2xx.h AP_BattMonitor: support I2C INA231 battery monitor 2024-07-11 09:26:17 +10:00
AP_BattMonitor_INA239.cpp AP_BattMonitor: create table of used backend paramater indices 2024-12-14 15:42:31 +11:00
AP_BattMonitor_INA239.h AP_BattMonitor: added MAX_AMPS and SHUNT parameters for INA239 2024-03-12 11:15:10 +11:00
AP_BattMonitor_INA3221.cpp AP_BattMonitor: INA3221: reallocate parameter indices 2024-12-14 15:42:31 +11:00
AP_BattMonitor_INA3221.h AP_BattMonitor: INA3221: fix up based on real experience 2024-12-02 10:10:01 -06:00
AP_BattMonitor_Logging.cpp AP_BattMonitor: add and use AP_BATTERY_ENABLED 2024-02-06 11:01:02 +11:00
AP_BattMonitor_LTC2946.cpp AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_LTC2946.h AP_BattMonitor: fixed reset_remaining() for INAxxx and LTC2946 2023-08-10 07:43:25 +10:00
AP_BattMonitor_Params.cpp AP_BattMonitor: update FS actions metadata with DO_RETURN_PATH_START 2024-12-17 09:34:49 +11:00
AP_BattMonitor_Params.h AP_BattMonitor: add option minimum volt option 2024-10-01 10:05:01 +10:00
AP_BattMonitor_Scripting.cpp AP_BattMonitor: tidy defines in scripting backend 2024-02-14 23:43:41 +11:00
AP_BattMonitor_Scripting.h AP_BattMonitor: tidy defines in scripting backend 2024-02-14 23:43:41 +11:00
AP_BattMonitor_SMBus_Generic.cpp AP_BattMonitor: Fix some typos 2023-10-12 18:30:42 +11:00
AP_BattMonitor_SMBus_Generic.h AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_SMBus_Maxell.h AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_SMBus_NeoDesign.cpp AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_SMBus_NeoDesign.h AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_SMBus_Rotoye.cpp AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_SMBus_Rotoye.h AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_SMBus_Solo.cpp AP_BattMonitor: Fix some typos 2023-10-12 18:30:42 +11:00
AP_BattMonitor_SMBus_Solo.h SMBus :expanded SoloBMS to 6s 2023-09-26 10:17:02 +10:00
AP_BattMonitor_SMBus_SUI.cpp AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_SMBus_SUI.h AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_SMBus.cpp AP_BattMonitor: create table of used backend paramater indices 2024-12-14 15:42:31 +11:00
AP_BattMonitor_SMBus.h AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor_Sum.cpp AP_BattMonitor: create table of used backend paramater indices 2024-12-14 15:42:31 +11:00
AP_BattMonitor_Sum.h AP_BattMonitor: Sum: report average temperature 2024-07-30 11:00:49 +10:00
AP_BattMonitor_Synthetic_Current.cpp AP_BattMonitor: create table of used backend paramater indices 2024-12-14 15:42:31 +11:00
AP_BattMonitor_Synthetic_Current.h AP_BattMonitor: Fix some typos 2023-10-12 18:30:42 +11:00
AP_BattMonitor_Torqeedo.cpp AP_BattMonitor: torqeedo support for multiple instances 2024-05-08 17:51:09 +10:00
AP_BattMonitor_Torqeedo.h AP_BattMonitor: add defines for all battery backends 2023-03-10 08:48:24 +11:00
AP_BattMonitor.cpp AP_BattMonitor: add missing subgroup links to correct metadata gen 2024-12-14 15:42:31 +11:00
AP_BattMonitor.h AP_BattMonitor: add support for ina3221 triple-channel current/voltage sensor 2024-12-02 10:10:01 -06:00
LogStructure.h AP_BattMonitor: support logging state-of-health percentage 2024-01-10 18:38:25 +11:00