Commit a44a3bad authored by Astro's avatar Astro

bhi160: fix buf capacity

parent 4312116d
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment