mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 09:53:33 +08:00
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:
@@ -41,12 +41,11 @@
|
||||
static constexpr int DEFAULT_V_CHANNEL[BOARD_NUMBER_BRICKS] = BOARD_BATT_V_LIST;
|
||||
static constexpr int DEFAULT_I_CHANNEL[BOARD_NUMBER_BRICKS] = BOARD_BATT_I_LIST;
|
||||
#else
|
||||
static constexpr int DEFAULT_V_CHANNEL[BOARD_NUMBER_BRICKS] = {0};
|
||||
static constexpr int DEFAULT_I_CHANNEL[BOARD_NUMBER_BRICKS] = {0};
|
||||
#error "BOARD_BATT_V_LIST and BOARD_BATT_I_LIST need to be defined"
|
||||
#endif
|
||||
#else
|
||||
static constexpr int DEFAULT_V_CHANNEL[1] = {0};
|
||||
static constexpr int DEFAULT_I_CHANNEL[1] = {0};
|
||||
static constexpr int DEFAULT_V_CHANNEL[1] = {-1};
|
||||
static constexpr int DEFAULT_I_CHANNEL[1] = {-1};
|
||||
#endif
|
||||
|
||||
AnalogBattery::AnalogBattery(int index, ModuleParams *parent, const int sample_interval_us, const uint8_t source,
|
||||
|
||||
Reference in New Issue
Block a user