Skip to content
Snippets Groups Projects
Verified Commit 82b02fa1 authored by rahix's avatar rahix
Browse files

chore(bme680): Minor style fixes


Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 772d1fd9
No related branches found
No related tags found
No related merge requests found
#include <stdbool.h> #include "epicardium.h"
#include <stddef.h> #include "modules/modules.h"
#include <stdio.h> #include "modules/log.h"
#include "card10.h"
#include "bme680.h" #include "bme680.h"
#include "bosch.h" #include "bosch.h"
#include "card10.h"
#include "epicardium.h" #include <stdbool.h>
#include "modules.h" #include <stddef.h>
#include "modules/log.h" #include <stdio.h>
#define HEATR_TEMP 320 #define HEATR_TEMP 320
#define HEATR_DUR 150 #define HEATR_DUR 150
...@@ -42,9 +43,12 @@ int epic_bme680_init() ...@@ -42,9 +43,12 @@ int epic_bme680_init()
bme.read = card10_bosch_i2c_read; bme.read = card10_bosch_i2c_read;
bme.write = card10_bosch_i2c_write; bme.write = card10_bosch_i2c_write;
bme.delay_ms = card10_bosch_delay; 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; bme.amb_temp = 25;
result = bme680_init(&bme); result = bme680_init(&bme);
...@@ -53,8 +57,10 @@ int epic_bme680_init() ...@@ -53,8 +57,10 @@ int epic_bme680_init()
return -convert_error(result); 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; bme.power_mode = BME680_FORCED_MODE;
/* Set the temperature, pressure and humidity settings */ /* Set the temperature, pressure and humidity settings */
...@@ -131,9 +137,9 @@ int epic_bme680_read_sensors(struct bme680_sensor_data *data) ...@@ -131,9 +137,9 @@ int epic_bme680_read_sensors(struct bme680_sensor_data *data)
return -convert_error(result); return -convert_error(result);
} }
data->temperature = raw_data.temperature / 100.0l; data->temperature = (float)raw_data.temperature / 100.0f;
data->humidity = raw_data.humidity / 1000.0l; data->humidity = raw_data.humidity / 1000.0f;
data->pressure = raw_data.pressure / 100.0l; data->pressure = raw_data.pressure / 100.0f;
data->gas_resistance = raw_data.gas_resistance; data->gas_resistance = raw_data.gas_resistance;
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment