nuttx/drivers/analog
Michał Łyszczek 459b4434b1 drivers/analog/hx711.c: fix averaging on negative values
ptype of ((int32_t)0 * (uint32_t)0) is (unsigned). "i" counter was
declared unsigned to not make comparision with "unsigned char" in for loop.
This resulted in calculation in average to be implicitly casted to unsigned,
and when negative number was added to it, it turned into huge value.

Change type of "i" to signed, and just cast (unsigned char) to (int)
to fix this.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
2024-03-03 01:56:40 +08:00
..
ad5410.c
adc.c
ads1242.c
ads1255.c
ads7828.c
CMakeLists.txt drivers/analog/hx711.c: Add driver for hx711 adc 2024-02-26 19:16:51 -03:00
comp.c
dac7554.c
dac7571.c
dac.c
hx711.c drivers/analog/hx711.c: fix averaging on negative values 2024-03-03 01:56:40 +08:00
Kconfig drivers/analog/hx711.c: Add driver for hx711 adc 2024-02-26 19:16:51 -03:00
lmp92001.c
ltc1867l.c
Make.defs drivers/analog/hx711.c: Add driver for hx711 adc 2024-02-26 19:16:51 -03:00
max1161x.c
mcp48xx.c
opamp.c
pga11x.c