WIP: initial support for fixed-point data for sensors#17408
WIP: initial support for fixed-point data for sensors#17408raiden00pl wants to merge 7 commits intoapache:masterfrom
Conversation
4dfeb92 to
8cd1558
Compare
5fdb41a to
329d6ff
Compare
329d6ff to
633521b
Compare
new sensor framework can now select between float data type and fixed-point data type Signed-off-by: raiden00pl <raiden00@railab.me>
support for fixed-point data for bmp280_uorb Signed-off-by: raiden00pl <raiden00@railab.me>
support for fixed-point data for bmp180_uorb Signed-off-by: raiden00pl <raiden00@railab.me>
support for fixed-point data for hyt271_uorb Signed-off-by: raiden00pl <raiden00@railab.me>
support for fixed-point data for adxl362_uorb Signed-off-by: raiden00pl <raiden00@railab.me>
0404a32 to
dde5a82
Compare
support for fixed-point data for adxl372_uorb Signed-off-by: raiden00pl <raiden00@railab.me>
support for fixed-point data for bh1749nuc_uorb Signed-off-by: raiden00pl <raiden00@railab.me>
|
One more thing about this; we should investigate if b16 is ever too small for a sensor's resolution. I would imagine a) having those sensors depend on the float representation, so users can only use them with floats What do you think? |
|
It would be best to choose sensor units that make sense for both float and fixed-point. With this architecture it should be possible to add other data types for sensors, but using 64-bit data seems like a overkill to me. So far, the highest resolution of data in commercial available sensors that I have seen is 24 bits. |
Summary
WIP code for fixed-math data type for sensors.
All sensor math operations will require modification to use
sensor_data_xxxmacros.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_uorbto 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:
depends on SENSORS_USE_FLOATImpact
Testing