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")