Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
chris007
firmware
Commits
fd7e85a5
Commit
fd7e85a5
authored
5 years ago
by
chris007
Browse files
Options
Downloads
Patches
Plain Diff
Fix lint errors
parent
783fb2d2
No related branches found
No related tags found
No related merge requests found
Pipeline
#2757
passed
5 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
epicardium/modules/bme680.c
+72
-65
72 additions, 65 deletions
epicardium/modules/bme680.c
pycardium/modules/bme680.c
+7
-10
7 additions, 10 deletions
pycardium/modules/bme680.c
with
79 additions
and
75 deletions
epicardium/modules/bme680.c
+
72
−
65
View file @
fd7e85a5
...
...
@@ -33,11 +33,11 @@ static int convert_error(int8_t error)
}
}
int
epic_bme680_init
()
{
int
epic_bme680_init
()
{
int8_t
result
=
BME680_OK
;
if
(
__builtin_expect
(
!
initialized
,
0
))
{
bme
.
dev_id
=
BME680_I2C_ADDR_PRIMARY
;
bme
.
intf
=
BME680_I2C_INTF
;
bme
.
read
=
card10_bosch_i2c_read
;
...
...
@@ -77,7 +77,9 @@ int epic_bme680_init() {
result
=
bme680_set_sensor_settings
(
settings_sel
,
&
bme
);
if
(
result
!=
BME680_OK
)
{
LOG_ERR
(
"bme680"
,
"bme680_set_sensor_settings error: %d
\n
"
,
result
);
LOG_ERR
(
"bme680"
,
"bme680_set_sensor_settings error: %d
\n
"
,
result
);
return
-
convert_error
(
result
);
}
...
...
@@ -100,18 +102,23 @@ int epic_bme680_read_sensors(struct bme680_sensor_data *data)
bme680_get_profile_dur
(
&
profile_dur
,
&
bme
);
if
(
result
==
BME680_OK
)
{
result
=
bme680_set_sensor_mode
(
&
bme
);
/* Trigger a measurement */
result
=
bme680_set_sensor_mode
(
&
bme
);
/* Trigger a measurement */
if
(
result
!=
BME680_OK
)
{
LOG_ERR
(
"bme680"
,
"bme680_set_sensor_mode error: %d
\n
"
,
result
);
LOG_ERR
(
"bme680"
,
"bme680_set_sensor_mode error: %d
\n
"
,
result
);
return
-
convert_error
(
result
);
}
vTaskDelay
(
pdMS_TO_TICKS
(
profile_dur
));
/* Wait for the measurement to complete */
vTaskDelay
(
pdMS_TO_TICKS
(
profile_dur
));
/* Wait for the measurement to complete */
result
=
bme680_get_sensor_data
(
&
raw_data
,
&
bme
);
if
(
result
!=
BME680_OK
)
{
LOG_ERR
(
"bme680"
,
"bme680_get_sensor_data error: %d
\n
"
,
result
);
LOG_ERR
(
"bme680"
,
"bme680_get_sensor_data error: %d
\n
"
,
result
);
return
-
convert_error
(
result
);
}
}
...
...
This diff is collapsed.
Click to expand it.
pycardium/modules/bme680.c
+
7
−
10
View file @
fd7e85a5
...
...
@@ -13,12 +13,10 @@ static mp_obj_t mp_bme680_get_data()
mp_raise_OSError
(
-
ret
);
}
mp_obj_t
values_list
[]
=
{
mp_obj_new_float
(
data
.
temperature
),
mp_obj_t
values_list
[]
=
{
mp_obj_new_float
(
data
.
temperature
),
mp_obj_new_float
(
data
.
humidity
),
mp_obj_new_float
(
data
.
pressure
),
mp_obj_new_float
(
data
.
gas_resistance
)
};
mp_obj_new_float
(
data
.
gas_resistance
)
};
return
mp_obj_new_tuple
(
4
,
values_list
);
}
static
MP_DEFINE_CONST_FUN_OBJ_0
(
bme680_get_data_obj
,
mp_bme680_get_data
);
...
...
@@ -47,6 +45,5 @@ const mp_obj_module_t bme680_module = {
.
globals
=
(
mp_obj_dict_t
*
)
&
bme680_module_globals
,
};
/* Register the module to make it available in Python */
MP_REGISTER_MODULE
(
MP_QSTR_bme680
,
bme680_module
,
MODULE_BME680_ENABLED
);
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