Skip to content

Commit 9384386

Browse files
committed
Fix INPUT_PULLUP issue #8
1 parent a2f3ac1 commit 9384386

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/arduino/am_sdk_ap3/mcu/apollo3/hal/am_hal_gpio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,9 @@ am_hal_gpio_pinconfig(uint32_t ui32Pin, am_hal_gpio_pincfg_t bfGpioCfg)
432432
return AM_HAL_GPIO_ERR_PULLDOWN;
433433
}
434434
}
435-
else if (bfGpioCfg.ePullup == AM_HAL_GPIO_PIN_PULLUP_WEAK)
435+
else if (bfGpioCfg.ePullup != AM_HAL_GPIO_PIN_PULLUP_WEAK)
436436
{
437-
if (g_ui8Bit76Capabilities[ui32Pin] & (CAP_PUP | CAP_PDN))
437+
if ((g_ui8Bit76Capabilities[ui32Pin] & (CAP_PUP | CAP_PDN)) == 0)
438438
{
439439
return AM_HAL_GPIO_ERR_PULLUP;
440440
}

0 commit comments

Comments
 (0)