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
m
rust-card10
Commits
a44a3bad
Commit
a44a3bad
authored
Aug 23, 2019
by
Astro
⚙
Browse files
bhi160: fix buf capacity
parent
4312116d
Changes
1
Hide whitespace changes
Inline
Side-by-side
l0dable/src/bhi160.rs
View file @
a44a3bad
...
...
@@ -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
,
...
...
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