drivers: sensor: vl53l1x: Allow for SENSOR_CHAN_ALL channel to be used
It mirrors the functionality of the vl53l0x driver. Also removes an assert not needed, as the channel is checked. Signed-off-by: Daniel Stuart <daniel.stuart14@gmail.com>
This commit is contained in:
parent
535278a3ba
commit
d9e7af6cdd
1 changed files with 2 additions and 3 deletions
|
@ -307,7 +307,8 @@ static int vl53l1x_sample_fetch(const struct device *dev,
|
|||
const struct vl53l1x_config *config = dev->config;
|
||||
VL53L1_Error ret;
|
||||
|
||||
__ASSERT_NO_MSG(chan == SENSOR_CHAN_DISTANCE);
|
||||
__ASSERT_NO_MSG((chan == SENSOR_CHAN_ALL)
|
||||
|| (chan == SENSOR_CHAN_DISTANCE));
|
||||
|
||||
/* Will immediately stop current measurement */
|
||||
ret = VL53L1_StopMeasurement(&drv_data->vl53l1x);
|
||||
|
@ -340,8 +341,6 @@ static int vl53l1x_channel_get(const struct device *dev,
|
|||
struct vl53l1x_data *drv_data = dev->data;
|
||||
VL53L1_Error ret;
|
||||
|
||||
__ASSERT_NO_MSG(chan == SENSOR_CHAN_DISTANCE);
|
||||
|
||||
if (chan != SENSOR_CHAN_DISTANCE) {
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue