mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 14:03:39 +00:00
machine: only enable USB-CDC when needed
Enabling USB consumes a lot of power. So it's better to keep it disabled by default when the serial port is set to something other than "usb" (USB-CDC). On my nice!nano clone, it reduces current consumption from 1mA to 0.13mA (and most of the rest is probably consumed by a connected SCD41 sensor). This change might break some expectations, when a board uses USB but not USB-CDC (I think this is rare, but I didn't check specifically).
This commit is contained in:
committed by
Ron Evans
parent
01723025d7
commit
571f34e0e6
@@ -519,6 +519,10 @@ type Serialer interface {
|
||||
RTS() bool
|
||||
}
|
||||
|
||||
func initUSB() {
|
||||
// nothing to do here
|
||||
}
|
||||
|
||||
// USB Serial/JTAG Controller
|
||||
// See esp32-c3_technical_reference_manual_en.pdf
|
||||
// pg. 736
|
||||
|
||||
Reference in New Issue
Block a user