Revert "Update bmp280.c"

This reverts commit c8a590f878.
This commit is contained in:
lilian 2016-09-07 14:25:17 +02:00
parent 5b40061bf9
commit 264ec4ca5f

View file

@ -61,7 +61,6 @@ void bmp280_init_default_params(bmp280_params_t *params)
params->mode = BMP280_MODE_NORMAL;
params->filter = BMP280_FILTER_OFF;
params->oversampling = BMP280_STANDARD;
params->oversampling_temperature = BMP280_STANDARD ;
params->oversampling_humidity = BMP280_STANDARD;
params->standby = BMP280_STANDBY_250;
}
@ -195,11 +194,14 @@ bool bmp280_init(bmp280_t *dev, bmp280_params_t *params)
return false;
}
uint8_t oversampling_temp =
(params->oversampling == BMP280_ULTRA_HIGH_RES) ? 2 : 1;
if (params->mode == BMP280_MODE_FORCED) {
params->mode = BMP280_MODE_SLEEP; // initial mode for forced is sleep
}
uint8_t ctrl = (params->oversampling_temperature << 5) | (params->oversampling << 2)
uint8_t ctrl = (oversampling_temp << 5) | (params->oversampling << 2)
| (params->mode);