aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/runtime/runtime_atsamd51.go
diff options
context:
space:
mode:
authorsago35 <[email protected]>2022-03-10 20:32:19 +0900
committerGitHub <[email protected]>2022-03-10 12:32:19 +0100
commita1b4eafa07a054a5e64fff984171cba81f88b176 (patch)
treef6d9dfec63aed0d6a0c63fc5e60adf88c53d8945 /src/runtime/runtime_atsamd51.go
parentccbe03795a3f7f7e68b202998eddf6dfaaa87ef3 (diff)
downloadtinygo-a1b4eafa07a054a5e64fff984171cba81f88b176.tar.gz
tinygo-a1b4eafa07a054a5e64fff984171cba81f88b176.zip
samd21,samd51: fix usbcdc initialization when -serial=uart (#2631)
machine/samd21,samd51: fix usbcdc initialization when -serial=uart by using machine.USB.Configured()
Diffstat (limited to 'src/runtime/runtime_atsamd51.go')
-rw-r--r--src/runtime/runtime_atsamd51.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/runtime_atsamd51.go b/src/runtime/runtime_atsamd51.go
index ed2aa9c3d..a2438bac8 100644
--- a/src/runtime/runtime_atsamd51.go
+++ b/src/runtime/runtime_atsamd51.go
@@ -30,6 +30,9 @@ func init() {
// connect to USB CDC interface
machine.Serial.Configure(machine.UARTConfig{})
+ if !machine.USB.Configured() {
+ machine.USB.Configure(machine.UARTConfig{})
+ }
}
func putchar(c byte) {