1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

6 Commits

Author SHA1 Message Date
MrKevinWeiss
7a68fb0d5e
*Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +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
MrKevinWeiss
e047d013a7 sys/analog_util: Add Kconfig support 2021-02-22 14:54:14 +01:00
Bas Stottelaar
1b35d06a51 sys/*: realign ENABLE_DEBUG 2020-10-23 11:27:48 +02:00
Joakim Nohlgård
57f6081960 sys/analog_util: Refactor adc_map, fix compilation
Change the API to use int32_t instead of int, to allow for greater
flexibility on 8- and 16-bit platforms. Removed limitation on input
arguments that min < max. Times where it can be useful to have min > max
is when measuring a sensor where a higher measured voltage means a lower
physical value. For example a thermistor can be connected so that the
measured voltage goes down when the temperature goes up.
2018-04-16 13:53:49 +02:00
Hauke Petersen
a1e3bb1bfc sys: s/adc_util/analog_util/ and added DAC mapping 2016-03-14 20:39:31 +01:00