Skip to content

Commit 4f86d07

Browse files
committed
[DM/FIXUP] Fixup pin flags get from OFW
Only check HIGH or LOW Signed-off-by: GuEe-GUI <[email protected]>
1 parent ab0ca30 commit 4f86d07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/drivers/pin/dev_pin_ofw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ rt_ssize_t rt_ofw_get_named_pin(struct rt_ofw_node *np, const char *propname, in
117117

118118
if (out_value)
119119
{
120-
if (flags == (PIN_ACTIVE_HIGH | PIN_PUSH_PULL))
120+
if ((flags & 1) == PIN_ACTIVE_HIGH)
121121
{
122122
value = PIN_HIGH;
123123
}
124-
else if (flags == (PIN_ACTIVE_LOW | PIN_PUSH_PULL))
124+
else if ((flags & 1) == PIN_ACTIVE_LOW)
125125
{
126126
value = PIN_LOW;
127127
}

0 commit comments

Comments
 (0)