nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

WIP: initial support for fixed-point data for sensors

Open raiden00pl opened this issue 1 month ago • 0 comments

Summary

WIP code for fixed-math data type for sensors.

All sensor math operations will require modification to use sensor_data_xxx macros.

At the moment, no sensor is modified to handle this properly. I'll probably choose the easiest sensor to port with a small amount of math operations to provide PoC.

EDIT: ported bmp280_uorb to fixed-math, probably the easiest one :)

Ultimately, all sensor units must be checked to see if the data unit make sense for the b16_t type.

Doing this work all at once is a lot of work which I don't want to do, so I suggest introducing this change gradually:

  1. introducing a configurable sensor data type and raise compilation error in all sensors that don't support fixed-point data type
  2. gradually port sensors to use fixed-point data and remove compilation errors
  3. on the app side we need to modify uorb tools to work with fixed-point data. At this moment we can just raise compilation error for fixed-point data type, and add depends on SENSORS_USE_FLOAT

Impact

Testing

raiden00pl avatar Nov 29 '25 20:11 raiden00pl