From d264dcb9418036935a991561d8735611d73bfddb Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 21 Oct 2024 12:01:04 +0200 Subject: [PATCH] fe310: support GPIO PinInput This is needed to support switching between input and output. --- src/machine/machine_fe310.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/machine/machine_fe310.go b/src/machine/machine_fe310.go index 37f3ee07e8..4a15ad76e1 100644 --- a/src/machine/machine_fe310.go +++ b/src/machine/machine_fe310.go @@ -26,6 +26,8 @@ const ( func (p Pin) Configure(config PinConfig) { sifive.GPIO0.INPUT_EN.SetBits(1 << uint8(p)) switch config.Mode { + case PinInput: + sifive.GPIO0.OUTPUT_EN.ClearBits(1 << uint8(p)) case PinOutput: sifive.GPIO0.OUTPUT_EN.SetBits(1 << uint8(p)) case PinPWM: