1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/analog_util
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
..
adc_util.c sys/*: realign ENABLE_DEBUG 2020-10-23 11:27:48 +02:00
dac_util.c sys/analog_util/dac_util: fix truncation bug 2022-12-09 13:58:12 -05:00
Kconfig sys/analog_util: Add Kconfig support 2021-02-22 14:54:14 +01:00
Makefile sys: s/adc_util/analog_util/ and added DAC mapping 2016-03-14 20:39:31 +01:00