nuttx
nuttx copied to clipboard
WIP: initial support for fixed-point data for sensors
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:
- introducing a configurable sensor data type and raise compilation error in all sensors that don't support fixed-point data type
- gradually port sensors to use fixed-point data and remove compilation errors
- 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