Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
swym
firmware
Commits
82b02fa1
Verified
Commit
82b02fa1
authored
Aug 22, 2019
by
Rahix
Browse files
chore(bme680): Minor style fixes
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
772d1fd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
epicardium/modules/bme680.c
View file @
82b02fa1
#include
<stdbool.h>
#include
<stddef.h>
#include
<stdio.h>
#include
"epicardium.h"
#include
"modules/modules.h"
#include
"modules/log.h"
#include
"card10.h"
#include
"bme680.h"
#include
"bosch.h"
#include
"card10.h"
#include
"epicardium
.h
"
#include
"modules
.h
"
#include
"modules/log
.h
"
#include
<stdbool
.h
>
#include
<stddef
.h
>
#include
<stdio
.h
>
#define HEATR_TEMP 320
#define HEATR_DUR 150
...
...
@@ -42,9 +43,12 @@ int epic_bme680_init()
bme
.
read
=
card10_bosch_i2c_read
;
bme
.
write
=
card10_bosch_i2c_write
;
bme
.
delay_ms
=
card10_bosch_delay
;
/* amb_temp can be set to 25 prior to configuring the gas sensor
* or by performing a few temperature readings without operating the gas sensor.
*/
/*
* amb_temp can be set to 25 prior to configuring the gas sensor
* or by performing a few temperature readings without operating
* the gas sensor.
*/
bme
.
amb_temp
=
25
;
result
=
bme680_init
(
&
bme
);
...
...
@@ -53,8 +57,10 @@ int epic_bme680_init()
return
-
convert_error
(
result
);
}
/* Select the power mode */
/* Must be set before writing the sensor configuration */
/*
* Select the power mode. Must be set before writing the sensor
* configuration
*/
bme
.
power_mode
=
BME680_FORCED_MODE
;
/* Set the temperature, pressure and humidity settings */
...
...
@@ -131,9 +137,9 @@ int epic_bme680_read_sensors(struct bme680_sensor_data *data)
return
-
convert_error
(
result
);
}
data
->
temperature
=
raw_data
.
temperature
/
100
.
0
l
;
data
->
humidity
=
raw_data
.
humidity
/
1000
.
0
l
;
data
->
pressure
=
raw_data
.
pressure
/
100
.
0
l
;
data
->
temperature
=
(
float
)
raw_data
.
temperature
/
100
.
0
f
;
data
->
humidity
=
raw_data
.
humidity
/
1000
.
0
f
;
data
->
pressure
=
raw_data
.
pressure
/
100
.
0
f
;
data
->
gas_resistance
=
raw_data
.
gas_resistance
;
return
0
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment