Skip to content

Commit 4dfeb92

Browse files
committed
sensors/bmp280_uorb: support for fixed-point data
Signed-off-by: raiden00pl <[email protected]>
1 parent 16b8b16 commit 4dfeb92

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

drivers/sensors/bmp280_uorb.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@
4545
* Pre-processor Definitions
4646
****************************************************************************/
4747

48-
/* Only float data type supported now */
49-
50-
#ifdef CONFIG_SENSORS_USE_B16
51-
# error fixed-point data type not supported yet
52-
#endif
53-
5448
#ifdef CONFIG_BMP280_I2C_ADDR_76
5549
#define BMP280_ADDR 0x76
5650
#else
@@ -665,8 +659,8 @@ static int bmp280_fetch(FAR struct sensor_lowerhalf_s *lower,
665659
clock_systime_timespec(&ts);
666660

667661
baro_data.timestamp = 1000000ull * ts.tv_sec + ts.tv_nsec / 1000;
668-
baro_data.pressure = press / 100.0f;
669-
baro_data.temperature = temp / 100.0f;
662+
baro_data.pressure = sensor_data_divi(press, 100);
663+
baro_data.temperature = sensor_data_divi(temp, 100);
670664

671665
memcpy(buffer, &baro_data, sizeof(baro_data));
672666

0 commit comments

Comments
 (0)