summaryrefslogtreecommitdiff
path: root/ports/esp32/main.c
diff options
context:
space:
mode:
authorDaniël van de Giessen <daniel@dvdgiessen.nl>2023-06-29 14:55:34 +0200
committerDamien George <damien@micropython.org>2023-09-01 21:01:26 +1000
commitf8bd6778c85322b33008d749ae4021cafa067044 (patch)
treef5325c1f4c371d517e4fe86b8385bc95e2bf0804 /ports/esp32/main.c
parentba8aad3d1dbc25a397c9b23b1428018c5a7be505 (diff)
esp32: Support JTAG console, free up UART.
CONFIG_USB_OTG_SUPPORTED is automatically set by the ESP-IDF when the chip supports USB-OTG, which is the case for the ESP32-S2 and ESP32-S3. When trying to use the JTAG console with these chips, it would not work because our USB implementation will take over control over the USB port, breaking the JTAG console in the process. Thus, when the board is configured to use the JTAG console, we should not enable our USB console support. Additionally, this change also frees up UART0 when an USB-based console is configured, since there's no reason to prevent (re)configuration of UART0 for other uses in that case. Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
Diffstat (limited to 'ports/esp32/main.c')
-rw-r--r--ports/esp32/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ports/esp32/main.c b/ports/esp32/main.c
index a6346b027..1420dd579 100644
--- a/ports/esp32/main.c
+++ b/ports/esp32/main.c
@@ -89,10 +89,10 @@ void mp_task(void *pvParameter) {
#if MICROPY_PY_THREAD
mp_thread_init(pxTaskGetStackStart(NULL), MP_TASK_STACK_SIZE / sizeof(uintptr_t));
#endif
- #if CONFIG_USB_OTG_SUPPORTED
- usb_init();
- #elif CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
+ #if CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
usb_serial_jtag_init();
+ #elif CONFIG_USB_OTG_SUPPORTED
+ usb_init();
#endif
#if MICROPY_HW_ENABLE_UART_REPL
uart_stdout_init();