Skip to content
Snippets Groups Projects
Commit a44a3bad authored by Astro's avatar Astro :gear:
Browse files

bhi160: fix buf capacity

parent 4312116d
Branches
No related tags found
No related merge requests found
......@@ -40,6 +40,7 @@ impl SensorType for Orientation {
}
}
const DATA_MAX: usize = 10;
pub struct Sensor<S: SensorType> {
stream_id: i32,
......@@ -64,7 +65,7 @@ impl<S: SensorType> Sensor<S> {
}
pub fn read(&self) -> SensorData<S> {
let mut buf: [bhi160_data_vector; 100] = unsafe {
let mut buf: [bhi160_data_vector; DATA_MAX] = unsafe {
uninitialized()
};
let n = unsafe {
......@@ -87,8 +88,6 @@ impl<S: SensorType> Drop for Sensor<S> {
}
}
const DATA_MAX: usize = 10;
pub struct SensorData<S> {
buf: [bhi160_data_vector; DATA_MAX],
n: usize,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment