Verified Commit 772d1fd9 authored by Rahix's avatar Rahix
Browse files

fix(bme680): Deinit only after initialization


Signed-off-by: Rahix's avatarRahix <rahix@rahix.de>
parent e08ab5df
......@@ -89,12 +89,14 @@ int epic_bme680_init()
int epic_bme680_deinit()
{
int8_t result = BME680_OK;
result = bme680_soft_reset(&bme);
if (result != BME680_OK) {
LOG_ERR("bme680", "bme680_soft_reset error: %d\n", result);
return -convert_error(result);
if (initialized) {
int8_t result = bme680_soft_reset(&bme);
if (result != BME680_OK) {
LOG_ERR("bme680",
"bme680_soft_reset error: %d\n",
result);
return -convert_error(result);
}
}
initialized = false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment