From 610dd19c40830b32c739792d16ecf88e76b136cb Mon Sep 17 00:00:00 2001 From: Dima Jolkin Date: Tue, 17 Feb 2026 19:31:48 +0200 Subject: [PATCH] esp32s3-usbserial: move InitSerial to init method --- src/runtime/runtime_esp32c3.go | 9 +++++---- src/runtime/runtime_esp32s3.go | 8 +++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/runtime/runtime_esp32c3.go b/src/runtime/runtime_esp32c3.go index 013c93924..f85f7dec7 100644 --- a/src/runtime/runtime_esp32c3.go +++ b/src/runtime/runtime_esp32c3.go @@ -54,10 +54,6 @@ func main() { // Configure interrupt handler interruptInit() - // Initialize UART. - machine.USBCDC.Configure(machine.UARTConfig{}) - machine.InitSerial() - // Initialize main system timer used for time.Now. initTimer() @@ -68,6 +64,11 @@ func main() { exit(0) } +func init() { + // Initialize UART. + machine.InitSerial() +} + func abort() { // lock up forever for { diff --git a/src/runtime/runtime_esp32s3.go b/src/runtime/runtime_esp32s3.go index ab0d85d73..b469ddf9e 100644 --- a/src/runtime/runtime_esp32s3.go +++ b/src/runtime/runtime_esp32s3.go @@ -72,9 +72,6 @@ func main() { clearbss() } - // Initialize UART. - machine.InitSerial() - // Initialize main system timer used for time.Now. initTimer() @@ -85,6 +82,11 @@ func main() { exit(0) } +func init() { + // Initialize UART. + machine.InitSerial() +} + func abort() { // lock up forever print("abort called\n")