Skip to content

Conversation

@raiden00pl
Copy link
Member

@raiden00pl raiden00pl commented Nov 29, 2025

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

@github-actions github-actions bot added Area: OS Components OS Components issues Area: Sensors Sensors issues Size: L The size of the change in this PR is large labels Nov 29, 2025
@raiden00pl raiden00pl force-pushed the sensors_fixedmath branch 2 times, most recently from 4dfeb92 to 8cd1558 Compare November 29, 2025 21:15
@raiden00pl raiden00pl force-pushed the sensors_fixedmath branch 8 times, most recently from 5fdb41a to 329d6ff Compare December 1, 2025 14:22
@github-actions github-actions bot added the Area: Documentation Improvements or additions to documentation label Dec 1, 2025
new sensor framework can now select between float data type and
fixed-point data type

Signed-off-by: raiden00pl <[email protected]>
support for fixed-point data for bmp280_uorb

Signed-off-by: raiden00pl <[email protected]>
support for fixed-point data for bmp180_uorb

Signed-off-by: raiden00pl <[email protected]>
support for fixed-point data for hyt271_uorb

Signed-off-by: raiden00pl <[email protected]>
support for fixed-point data for adxl362_uorb

Signed-off-by: raiden00pl <[email protected]>
@raiden00pl raiden00pl force-pushed the sensors_fixedmath branch 2 times, most recently from 0404a32 to dde5a82 Compare December 1, 2025 16:52
support for fixed-point data for adxl372_uorb

Signed-off-by: raiden00pl <[email protected]>
support for fixed-point data for bh1749nuc_uorb

Signed-off-by: raiden00pl <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Documentation Improvements or additions to documentation Area: OS Components OS Components issues Area: Sensors Sensors issues Size: L The size of the change in this PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants