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

fix(bme680): Deinit only after initialization


Signed-off-by: default avatarRahix <rahix@rahix.de>
parent e08ab5df
No related branches found
No related tags found
No related merge requests found
...@@ -89,13 +89,15 @@ int epic_bme680_init() ...@@ -89,13 +89,15 @@ int epic_bme680_init()
int epic_bme680_deinit() int epic_bme680_deinit()
{ {
int8_t result = BME680_OK; if (initialized) {
int8_t result = bme680_soft_reset(&bme);
result = bme680_soft_reset(&bme);
if (result != BME680_OK) { if (result != BME680_OK) {
LOG_ERR("bme680", "bme680_soft_reset error: %d\n", result); LOG_ERR("bme680",
"bme680_soft_reset error: %d\n",
result);
return -convert_error(result); return -convert_error(result);
} }
}
initialized = false; initialized = false;
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