Skip to content

Commit 714c379

Browse files
committed
squash decode fifio
1 parent 17dae96 commit 714c379

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

drivers/sensor/st/lsm6dsvxxx/lsm6dsvxxx_decoder.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,7 @@ static int lsm6dsvxxx_decode_fifo(const uint8_t *buffer, struct sensor_chan_spec
296296

297297
while (count < max_count && buffer < buffer_end) {
298298
const uint8_t *frame_end = buffer;
299-
uint8_t skip_frame;
300299

301-
skip_frame = 0;
302300
frame_end += LSM6DSVXXX_FIFO_ITEM_LEN;
303301

304302
fifo_tag = (buffer[0] >> 3);
@@ -325,9 +323,9 @@ static int lsm6dsvxxx_decode_fifo(const uint8_t *buffer, struct sensor_chan_spec
325323
out->readings[count].timestamp_delta =
326324
(xl_count - 1) * accel_period_ns[edata->accel_batch_odr];
327325

328-
x = *(int16_t *)&buffer[1];
329-
y = *(int16_t *)&buffer[3];
330-
z = *(int16_t *)&buffer[5];
326+
x = *(const int16_t *)&buffer[1];
327+
y = *(const int16_t *)&buffer[3];
328+
z = *(const int16_t *)&buffer[5];
331329

332330
out->shift = cfg->accel_bit_shift[header->accel_fs];
333331

@@ -356,9 +354,9 @@ static int lsm6dsvxxx_decode_fifo(const uint8_t *buffer, struct sensor_chan_spec
356354
out->readings[count].timestamp_delta =
357355
(gy_count - 1) * gyro_period_ns[edata->gyro_batch_odr];
358356

359-
x = *(int16_t *)&buffer[1];
360-
y = *(int16_t *)&buffer[3];
361-
z = *(int16_t *)&buffer[5];
357+
x = *(const int16_t *)&buffer[1];
358+
y = *(const int16_t *)&buffer[3];
359+
z = *(const int16_t *)&buffer[5];
362360

363361
out->shift = gyro_bit_shift[header->gyro_fs];
364362

@@ -388,7 +386,7 @@ static int lsm6dsvxxx_decode_fifo(const uint8_t *buffer, struct sensor_chan_spec
388386
out->readings[count].timestamp_delta =
389387
(temp_count - 1) * temp_period_ns[edata->temp_batch_odr];
390388

391-
t = *(int16_t *)&buffer[1];
389+
t = *(const int16_t *)&buffer[1];
392390
t_uC = SENSOR_TEMP_UCELSIUS(t);
393391

394392
out->shift = temp_bit_shift;

0 commit comments

Comments
 (0)