This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 37981b2b2f300509e432ead0f2827bd4e39be7fe
Author: raiden00pl <[email protected]>
AuthorDate: Sat Nov 29 22:05:39 2025 +0100

    sensors/bmp280_uorb: support for fixed-point data
    
    support for fixed-point data for bmp280_uorb
    
    Signed-off-by: raiden00pl <[email protected]>
---
 drivers/sensors/bmp280_uorb.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/sensors/bmp280_uorb.c b/drivers/sensors/bmp280_uorb.c
index 958ae5a9967..feaca0feee0 100644
--- a/drivers/sensors/bmp280_uorb.c
+++ b/drivers/sensors/bmp280_uorb.c
@@ -45,12 +45,6 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-/* Only float data type supported now */
-
-#ifdef CONFIG_SENSORS_USE_B16
-#  error fixed-point data type not supported yet
-#endif
-
 #ifdef  CONFIG_BMP280_I2C_ADDR_76
 #define BMP280_ADDR         0x76
 #else
@@ -665,8 +659,8 @@ static int bmp280_fetch(FAR struct sensor_lowerhalf_s 
*lower,
   clock_systime_timespec(&ts);
 
   baro_data.timestamp = 1000000ull * ts.tv_sec + ts.tv_nsec / 1000;
-  baro_data.pressure = press / 100.0f;
-  baro_data.temperature = temp / 100.0f;
+  baro_data.pressure = sensor_data_divi(press, 100);
+  baro_data.temperature = sensor_data_divi(temp, 100);
 
   memcpy(buffer, &baro_data, sizeof(baro_data));
 

Reply via email to