drivers/sensors/bmp280.c: Correct bmp280 driver

There were some mistakes in porting to the common sensors, and they
caused the following problems.

- Hardfault by bmp280_set_interval
- Read data always zero
This commit is contained in:
SPRESENSE 2021-08-19 14:10:27 +09:00 committed by Xiang Xiao
parent f8d036d70b
commit 38bfadbeb9
1 changed files with 4 additions and 2 deletions

View File

@ -506,7 +506,9 @@ static uint32_t bmp280_compensate_press(FAR struct bmp280_dev_s *priv,
static int bmp280_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR unsigned int *period_us)
{
FAR struct bmp280_dev_s *priv = (FAR struct bmp280_dev_s *)lower->priv;
FAR struct bmp280_dev_s *priv = container_of(lower,
FAR struct bmp280_dev_s,
sensor_lower);
int ret = 0;
uint8_t regval;
@ -653,7 +655,7 @@ static int bmp280_fetch(FAR struct sensor_lowerhalf_s *lower,
memcpy(buffer, &baro_data, sizeof(baro_data));
return ret;
return buflen;
}
/****************************************************************************