Skip to content

Commit

Permalink
fixup! drivers: add support for BME680 driver
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Mar 11, 2020
1 parent b8a3f3a commit d367276
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/bme680/bme680.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int bme680_init(bme680_t *dev, const bme680_params_t *params)
ret = bme680_init_internal(&BME680_SENSOR(dev));
if (ret != 0) {
DEBUG("[bme680]: Failed to get ID\n");
return -1;
return ret;
}

/* retrieve params and set them in bme680_t */
Expand All @@ -105,7 +105,6 @@ int bme680_init(bme680_t *dev, const bme680_params_t *params)
ret = bme680_set_sensor_settings(params->settings, &BME680_SENSOR(dev));
if (ret != 0) {
DEBUG("[bme680]: failed to set settings\n");
return -2;
}

return ret;
Expand Down Expand Up @@ -133,15 +132,15 @@ int bme680_get_data(bme680_t* dev, bme680_field_data_t *data)

int8_t res;
if ((res = bme680_get_sensor_data(data, &BME680_SENSOR(dev))) == 0) {
return 0;
return BME680_OK;
}

DEBUG("[bme680]: reading data failed with reason %d\n", res);

if (res == BME680_W_NO_NEW_DATA) {
return BME680_NO_NEW_DATA;
}
return BME680_INVALID;
return res;
}

int bme680_set_ambient_temp(bme680_t* dev, int8_t temp)
Expand Down

0 comments on commit d367276

Please sign in to comment.