Skip to content

Commit 9c93042

Browse files
lixuzhaMaureenHelm
authored andcommitted
drivers: sensor: lsm6dso: round up to the nearest odr
It was too strict to require the caller to pass in an accurate odr as a parameter. This patch is to round the odr up to the nearest one, when odr does not match. Signed-off-by: Zhang Lixu <[email protected]>
1 parent 32c566a commit 9c93042

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/sensor/lsm6dso/lsm6dso.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static int lsm6dso_freq_to_odr_val(uint16_t freq)
3131
size_t i;
3232

3333
for (i = 0; i < ARRAY_SIZE(lsm6dso_odr_map); i++) {
34-
if (freq == lsm6dso_odr_map[i]) {
34+
if (freq <= lsm6dso_odr_map[i]) {
3535
return i;
3636
}
3737
}

0 commit comments

Comments
 (0)