Commit c422dd98 authored by Nora's avatar Nora
Browse files

fix SensorDataIter

increase internal position at end of next function
parent 62b329ac
......@@ -136,8 +136,6 @@ impl<'a, S: SensorType> Iterator for SensorDataIter<'a, S> {
fn next(&mut self) -> Option<Self::Item> {
while self.pos < self.data.n {
self.pos += 1;
let vec = &self.data.buf[self.pos];
if vec.data_type != DATA_TYPE_VECTOR {
writeln!(crate::UART, "Sensor: skip type {}\r", vec.data_type).ok();
......@@ -151,6 +149,8 @@ impl<'a, S: SensorType> Iterator for SensorDataIter<'a, S> {
status: vec.status,
};
self.pos += 1;
return Some(item);
}
......
Supports Markdown
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