Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Astro
rust-card10
Commits
c422dd98
Commit
c422dd98
authored
Aug 27, 2019
by
Nora
Browse files
fix SensorDataIter
increase internal position at end of next function
parent
62b329ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
l0dable/src/bhi160.rs
View file @
c422dd98
...
...
@@ -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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment