From 6e68d55f8a9bba21ffe52dfed7d65956f954b9ad Mon Sep 17 00:00:00 2001 From: Lee Lup Yuen Date: Wed, 24 Nov 2021 16:45:48 +0800 Subject: [PATCH] Fix GPIO output --- arch/risc-v/src/bl602/bl602_gpio.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/risc-v/src/bl602/bl602_gpio.c b/arch/risc-v/src/bl602/bl602_gpio.c index 9778ee9c1e..5ab5063810 100644 --- a/arch/risc-v/src/bl602/bl602_gpio.c +++ b/arch/risc-v/src/bl602/bl602_gpio.c @@ -129,6 +129,14 @@ int bl602_configgpio(gpio_pinset_t cfgset) } modifyreg32(regaddr, mask, cfg); + + /* Enable pin output if requested */ + + if (!(cfgset & GPIO_INPUT)) + { + modifyreg32(BL602_GPIO_CFGCTL34, 0, (1 << pin)); + } + return OK; }