Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flow3r
flow3r firmware
Commits
0eb7a2d0
Commit
0eb7a2d0
authored
1 year ago
by
schneider
Committed by
q3k
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
bmp581: mpy support
parent
f626c7d0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/micropython/usermodule/mp_imu.c
+16
-0
16 additions, 0 deletions
components/micropython/usermodule/mp_imu.c
with
16 additions
and
0 deletions
components/micropython/usermodule/mp_imu.c
+
16
−
0
View file @
0eb7a2d0
...
...
@@ -16,8 +16,24 @@ STATIC mp_obj_t mp_imu_acc_read(void) {
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
mp_imu_acc_read_obj
,
mp_imu_acc_read
);
STATIC
mp_obj_t
mp_imu_pressure_read
(
void
)
{
static
float
pressure
,
temperature
;
// Will not overwrite old data if there is an error
st3m_imu_read_pressure
(
&
pressure
,
&
temperature
);
mp_obj_t
items
[]
=
{
mp_obj_new_float
(
pressure
),
mp_obj_new_float
(
temperature
)
};
return
mp_obj_new_tuple
(
2
,
items
);
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
mp_imu_pressure_read_obj
,
mp_imu_pressure_read
);
STATIC
const
mp_rom_map_elem_t
globals_table
[]
=
{
{
MP_ROM_QSTR
(
MP_QSTR_acc_read
),
MP_ROM_PTR
(
&
mp_imu_acc_read_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_pressure_read
),
MP_ROM_PTR
(
&
mp_imu_pressure_read_obj
)
},
};
STATIC
MP_DEFINE_CONST_DICT
(
globals
,
globals_table
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment