Skip to content

Commit

Permalink
applications: nrf_desktop: Add missing sample_fetch for qdec in wheel
Browse files Browse the repository at this point in the history
Added sensor_sample-fetch before sensor_channel_get which is
now required by updated qdec driver properly implementing
zephyr sensor API.

Signed-off-by: Michał Stasiak <[email protected]>
  • Loading branch information
mstasiaknordic authored and rlubos committed Oct 21, 2024
1 parent 0bfab68 commit 6d40ee4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion applications/nrf_desktop/src/hw_interface/wheel.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,16 @@ static void data_ready_handler(const struct device *dev, const struct sensor_tri
k_spin_unlock(&lock, key);
}

int err = sensor_sample_fetch_chan(qdec_dev, SENSOR_CHAN_ROTATION);

if (err) {
LOG_ERR("Cannot fetch sensor sample (err %d)", err);
return;
}

struct sensor_value value;

int err = sensor_channel_get(qdec_dev, SENSOR_CHAN_ROTATION, &value);
err = sensor_channel_get(qdec_dev, SENSOR_CHAN_ROTATION, &value);
if (err) {
LOG_ERR("Cannot get sensor value");
return;
Expand Down

0 comments on commit 6d40ee4

Please sign in to comment.