battery_status: do not publish if no voltage channel is defined

This is the case for boards with digital readout, like v5x, but still
enable the battery_status module for external analog driver options.

An alternative would be to not run battery_status depending on config.
This commit is contained in:
Beat Küng
2022-01-28 08:48:11 +01:00
committed by Daniel Agar
parent 10ad553f1d
commit b6607a7b78
3 changed files with 27 additions and 19 deletions
@@ -145,7 +145,10 @@
# define BOARD_BATT_I_LIST {ADC_BATTERY_CURRENT_CHANNEL}
# define BOARD_BRICK_VALID_LIST {BOARD_ADC_BRICK_VALID}
#elif BOARD_NUMBER_BRICKS == 2
# if !defined(BOARD_NUMBER_DIGITAL_BRICKS)
# if defined(BOARD_NUMBER_DIGITAL_BRICKS)
# define BOARD_BATT_V_LIST {-1, -1}
# define BOARD_BATT_I_LIST {-1, -1}
# else
# define BOARD_BATT_V_LIST {ADC_BATTERY1_VOLTAGE_CHANNEL, ADC_BATTERY2_VOLTAGE_CHANNEL}
# define BOARD_BATT_I_LIST {ADC_BATTERY1_CURRENT_CHANNEL, ADC_BATTERY2_CURRENT_CHANNEL}
# endif