summaryrefslogtreecommitdiff
path: root/ports/esp32/usb.c
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2024-07-30 10:39:47 +1000
committerDamien George <damien@micropython.org>2024-08-14 15:58:18 +1000
commit0a11832cddbeed57bf0267afa0c833584817312d (patch)
treeb340ba677337e19c61b5141e90f240a3085e5e99 /ports/esp32/usb.c
parentfbb02d3aeeaa9da082f3ccd411d8e164a526046e (diff)
esp32: Use the ESP-IDF default esp_console config for ESP32-C3.
The ESP-IDF default on C3 is primary UART0, secondary USB serial/jtag. Previously MicroPython configured the primary as USB Serial/JTAG and manually worked with the UART0 console. However UART0 console stopped working this way in v5.2.2. The big change is that CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is no longer set, as primary console is UART0. However CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG is set and IDF provides a macro CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED which is set if either primary or secondary esp_console is USB serial/jtag. So need to use that macro instead. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'ports/esp32/usb.c')
-rw-r--r--ports/esp32/usb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/esp32/usb.c b/ports/esp32/usb.c
index 2a3a2595d..5a0e6b8a9 100644
--- a/ports/esp32/usb.c
+++ b/ports/esp32/usb.c
@@ -28,7 +28,7 @@
#include "py/mphal.h"
#include "usb.h"
-#if CONFIG_USB_OTG_SUPPORTED && !CONFIG_ESP_CONSOLE_USB_CDC && !CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
+#if CONFIG_USB_OTG_SUPPORTED && !CONFIG_ESP_CONSOLE_USB_CDC && !CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED
#include "esp_timer.h"
#ifndef NO_QSTR
@@ -100,4 +100,4 @@ void usb_tx_strn(const char *str, size_t len) {
}
}
-#endif // CONFIG_USB_OTG_SUPPORTED && !CONFIG_ESP_CONSOLE_USB_CDC && !CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
+#endif // CONFIG_USB_OTG_SUPPORTED && !CONFIG_ESP_CONSOLE_USB_CDC && !CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED