mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
drivers/ioexpander: fix output inversion for ioe_dummy
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
committed by
Xiang Xiao
parent
fa0e5da18e
commit
041f25fe72
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user