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 <ycsin@meta.com>
This commit is contained in:
parent
24082d582f
commit
5f1e1c7b34
1 changed files with 1 additions and 2 deletions
|
@ -336,7 +336,6 @@ void sensor_shell_processing_callback(int result, uint8_t *buf, uint32_t buf_len
|
||||||
uint32_t fit = 0;
|
uint32_t fit = 0;
|
||||||
size_t base_size;
|
size_t base_size;
|
||||||
size_t frame_size;
|
size_t frame_size;
|
||||||
size_t channel_idx = 0;
|
|
||||||
uint16_t frame_count;
|
uint16_t frame_count;
|
||||||
|
|
||||||
/* Channels with multi-axis equivalents are skipped */
|
/* 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
|
||||||
PRIsensor_q31_data_arg(*data, 0));
|
PRIsensor_q31_data_arg(*data, 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
++channel_idx;
|
++ch.chan_idx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue