This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 6e68d55 Fix GPIO output
6e68d55 is described below
commit 6e68d55f8a9bba21ffe52dfed7d65956f954b9ad
Author: Lee Lup Yuen <[email protected]>
AuthorDate: Wed Nov 24 16:45:48 2021 +0800
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 9778ee9..5ab5063 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;
}