arch/xtensa/src/esp32/esp32_gpio.c: Enable input mode only when
configuring an input.
This commit is contained in:
parent
c52854f5bb
commit
b5d3ba64e0
@ -172,6 +172,10 @@ int esp32_configgpio(int pin, gpio_pinattr_t attr)
|
||||
|
||||
if ((attr & INPUT) != 0)
|
||||
{
|
||||
/* Enable input mode in the IO_MUX. */
|
||||
|
||||
func |= FUN_IE;
|
||||
|
||||
if (pin < 32)
|
||||
{
|
||||
putreg32((1ul << pin), GPIO_ENABLE_W1TC_REG);
|
||||
@ -209,10 +213,6 @@ int esp32_configgpio(int pin, gpio_pinattr_t attr)
|
||||
|
||||
func |= (uint32_t)(2ul << FUN_DRV_S);
|
||||
|
||||
/* Input enable... Required for output as well? */
|
||||
|
||||
func |= FUN_IE;
|
||||
|
||||
pinmode = (attr & PINMODE_MASK);
|
||||
if (pinmode == INPUT || pinmode == OUTPUT)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user