Skip to content

Commit 5f1e1c7

Browse files
ycsincarlescufi
authored andcommitted
drivers: sensor: sensor_shell: fix infinite loop when doing sensor get
Should increment `ch.chan_idx` instead of `channel_idx`, otherwise we will be stucked in the loop forever. Signed-off-by: Yong Cong Sin <[email protected]>
1 parent 24082d5 commit 5f1e1c7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/sensor/sensor_shell.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ void sensor_shell_processing_callback(int result, uint8_t *buf, uint32_t buf_len
336336
uint32_t fit = 0;
337337
size_t base_size;
338338
size_t frame_size;
339-
size_t channel_idx = 0;
340339
uint16_t frame_count;
341340

342341
/* Channels with multi-axis equivalents are skipped */
@@ -504,7 +503,7 @@ void sensor_shell_processing_callback(int result, uint8_t *buf, uint32_t buf_len
504503
PRIsensor_q31_data_arg(*data, 0));
505504
}
506505
}
507-
++channel_idx;
506+
++ch.chan_idx;
508507
}
509508
}
510509
}

0 commit comments

Comments
 (0)