1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 07:21:18 +01:00
Joshua DeWeese 86d751d4d3 sys/analog_util/dac_util: fix truncation bug
In `dac_util_map(...)` the expression `((value - min) * UINT16_MAX)` was
cast to a 16 bit unsigned, then divided by `(max - min)`. This means
that anytime `(value - min) != 0` the numerator was truncated prior to
being divided and then returned.

This patch modifies the expression so that the downcast to 16 bits is
performed as the last operation.
2022-12-09 13:58:12 -05:00
..
2022-09-16 14:00:35 +02:00
2022-11-10 23:44:50 +01:00
2022-03-11 09:24:12 +01:00
2022-01-10 12:21:40 +01:00
2022-01-13 17:50:59 +01:00
2022-11-15 22:05:42 +01:00
2022-09-29 22:01:37 +02:00
2021-12-07 13:00:58 +01:00
2022-09-26 19:06:46 +02:00
2022-03-11 09:20:24 +01:00
2021-12-07 16:31:15 +01:00
2022-12-05 16:13:21 +01:00
2022-02-11 12:38:21 +01:00
2022-09-05 07:46:56 +02:00
2021-11-24 17:54:44 +01:00
2022-09-29 22:01:37 +02:00