From f141444fde213b5888e8e1ed0f80176a1a439d13 Mon Sep 17 00:00:00 2001 From: jonathanfv Date: Thu, 27 Aug 2020 17:15:34 +0200 Subject: [PATCH] Update odroidc4.c _pullUpDnControl when called with PUD_UP sets a bit... That's in line with datasheet that says 1 = pull up. _getPUPD when the bit is set returns PUD_DOWN... --- wiringPi/odroidc4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiringPi/odroidc4.c b/wiringPi/odroidc4.c index 750c083..f26ca7b 100644 --- a/wiringPi/odroidc4.c +++ b/wiringPi/odroidc4.c @@ -422,7 +422,7 @@ static int _getPUPD (int pin) shift = gpioToShiftReg(pin); if (*(gpio + puen) & (1 << shift)) - return *(gpio + pupd) & (1 << shift) ? 1 : 2; + return *(gpio + pupd) & (1 << shift) ? 2 : 1; else return 0; }