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
card10
firmware
Commits
6388ed70
Commit
6388ed70
authored
Aug 27, 2019
by
Rahix
Browse files
Merge 'bhi160 disable_all_sensors in upy-module'
See merge request
!268
parents
37da10f9
00845136
Pipeline
#3593
passed with stages
in 55 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pycardium/modules/bhi160-sys.c
View file @
6388ed70
...
...
@@ -66,6 +66,17 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(
mp_bhi160_disable_sensor_obj
,
mp_bhi160_disable_sensor
);
STATIC
mp_obj_t
mp_bhi160_disable_all_sensors
()
{
epic_bhi160_disable_all_sensors
();
return
mp_const_none
;
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
mp_bhi160_disable_all_sensors_obj
,
mp_bhi160_disable_all_sensors
);
STATIC
const
mp_rom_map_elem_t
bhi160_module_globals_table
[]
=
{
{
MP_ROM_QSTR
(
MP_QSTR___name__
),
MP_ROM_QSTR
(
MP_QSTR_sys_bhi160
)
},
{
MP_ROM_QSTR
(
MP_QSTR_enable_sensor
),
...
...
@@ -74,6 +85,8 @@ STATIC const mp_rom_map_elem_t bhi160_module_globals_table[] = {
MP_ROM_PTR
(
&
mp_bhi160_read_sensor_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_disable_sensor
),
MP_ROM_PTR
(
&
mp_bhi160_disable_sensor_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_disable_all_sensors
),
MP_ROM_PTR
(
&
mp_bhi160_disable_all_sensors_obj
)
},
};
STATIC
MP_DEFINE_CONST_DICT
(
bhi160_module_globals
,
bhi160_module_globals_table
);
...
...
pycardium/modules/py/bhi160.py
View file @
6388ed70
...
...
@@ -5,6 +5,15 @@ import ucollections
DataVector
=
ucollections
.
namedtuple
(
"DataVector"
,
[
"x"
,
"y"
,
"z"
,
"status"
])
def
disable_all_sensors
():
"""
Disable all sensor also if they are already deactivated.
:returns: None
"""
sys_bhi160
.
disable_all_sensors
()
class
BHI160
:
def
enable_sensor
(
self
):
interrupt
.
disable_callback
(
self
.
interrupt_id
)
...
...
pycardium/modules/qstrdefs.h
View file @
6388ed70
...
...
@@ -67,6 +67,7 @@ Q(RTC_ALARM)
Q
(
sys_bhi160
)
Q
(
enable_sensor
)
Q
(
disable_sensor
)
Q
(
disable_all_sensors
)
Q
(
read_sensor
)
Q
(
x
)
Q
(
y
)
...
...
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