Browse Source

fix(bvd): Add SENSOR_CHAN_ALL support

xmkb
Nick 4 years ago committed by Pete Johanson
parent
commit
8779563896
  1. 4
      app/drivers/zephyr/battery_voltage_divider.c

4
app/drivers/zephyr/battery_voltage_divider.c

@ -61,7 +61,9 @@ static int bvd_sample_fetch(struct device *dev, enum sensor_channel chan) {
struct adc_sequence *as = &drv_data->as; struct adc_sequence *as = &drv_data->as;
// Make sure selected channel is supported // Make sure selected channel is supported
if (chan != SENSOR_CHAN_GAUGE_VOLTAGE && chan != SENSOR_CHAN_GAUGE_STATE_OF_CHARGE) { if (chan != SENSOR_CHAN_GAUGE_VOLTAGE && chan != SENSOR_CHAN_GAUGE_STATE_OF_CHARGE &&
chan != SENSOR_CHAN_ALL) {
LOG_DBG("Selected channel is not supported: %d.", chan);
return -ENOTSUP; return -ENOTSUP;
} }

Loading…
Cancel
Save