drivers/ioexpander: fix output inversion for ioe_dummy

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
Petro Karashchenko
2022-03-04 12:23:37 +01:00
committed by Xiang Xiao
parent fa0e5da18e
commit 041f25fe72
3 changed files with 28 additions and 36 deletions
+3 -3
View File
@@ -416,7 +416,7 @@ static int skel_getmultibits(FAR struct skel_dev_s *priv, FAR uint8_t *pins,
return -ENXIO;
}
values[i] = ((pinset & (1 << pin)) != 0);
values[i] = (((pinset >> pin) & 1) != 0);
}
return OK;
@@ -474,11 +474,11 @@ static int skel_multiwritepin(FAR struct ioexpander_dev_s *dev,
if (values[i])
{
pinset |= (1 << pin);
pinset |= ((ioe_pinset_t)1 << pin);
}
else
{
pinset &= ~(1 << pin);
pinset &= ~((ioe_pinset_t)1 << pin);
}
}