Skip to content

Commit 0356695

Browse files
committed
sensors: lsm6dsv16x: save gyro_fs in data
Save gyroscope range set from DT or SENSOR_ATTR in data structure. Signed-off-by: Armando Visconti <[email protected]>
1 parent 5f418f5 commit 0356695

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/sensor/st/lsm6dsv16x/lsm6dsv16x.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,13 @@ static int lsm6dsv16x_gyro_set_fs_raw(const struct device *dev, uint8_t fs)
151151
{
152152
const struct lsm6dsv16x_config *cfg = dev->config;
153153
stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx;
154+
struct lsm6dsv16x_data *data = dev->data;
154155

155156
if (lsm6dsv16x_gy_full_scale_set(ctx, fs) < 0) {
156157
return -EIO;
157158
}
158159

160+
data->gyro_fs = fs;
159161
return 0;
160162
}
161163

0 commit comments

Comments
 (0)