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
Øyvind Kolås
firmware
Commits
36f4efbc
Commit
36f4efbc
authored
Oct 13, 2020
by
schneider
Browse files
fix(bhi160): Allow to re-open the sensor from Python
Closes #210
parent
ef0001bd
Changes
1
Show whitespace changes
Inline
Side-by-side
pycardium/modules/py/bhi160.py
View file @
36f4efbc
...
...
@@ -18,6 +18,11 @@ class BHI160:
def
enable_sensor
(
self
):
interrupt
.
disable_callback
(
self
.
interrupt_id
)
interrupt
.
set_callback
(
self
.
interrupt_id
,
self
.
_interrupt
)
# If the sensor is already enabled, disable it first.
# The call is allowed to silently fail.
sys_bhi160
.
disable_sensor
(
self
.
sensor_id
)
self
.
stream_id
=
sys_bhi160
.
enable_sensor
(
self
.
sensor_id
,
self
.
sample_buffer_len
,
self
.
sample_rate
,
self
.
dynamic_range
)
...
...
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