drivers: sensor: tenstorrent: pvt: use float instead of sensor_value#980
drivers: sensor: tenstorrent: pvt: use float instead of sensor_value#980alexapostolu wants to merge 1 commit intotenstorrent:mainfrom
Conversation
Use float instead of sensor value when decoding from the rtio buffer. This simplifies conversions making the code shorter and neater. Signed-off-by: Alex Apostolu <aapostolu@tenstorrent.com>
|
I think Zephyr drivers try to avoid using floating point as much as possible (maybe that's a strict rule?), hence the weird sensor_value convention. Maybe it's ok for us to use floating point to simplify the code, since we know the sensor driver will only be used on BH where we know there is an FPU. Thoughts @danieldegrasse @jgrowdenTT @alewycky-tenstorrent? |
|
Yea, we have an FPU, we don't have any cases where we need to be really precise with the floating point, and we do use the float immediately after the decode stage, |
|
Looks like the decode stage is also already using float? |
|
@afongTT Yea the decode stage converts the raw sensor value into a float. Sorry what I meant is that the decode value is used right away after decoding, so we minimize the cases where we just have a float sitting around doing nothing |
Use float instead of sensor value when decoding from the rtio buffer. This simplifies conversions making the code shorter and neater.