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:
parent
f8d036d70b
commit
38bfadbeb9
|
@ -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;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
Loading…
Reference in New Issue