diff options
| author | Garry W <32130780+garywill@users.noreply.github.com> | 2024-11-14 04:19:31 +0000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-03-13 13:06:56 +1100 |
| commit | 4d2d60d6e1422dc5a66f15f7e48e3ebad2dfc41c (patch) | |
| tree | 2a162d534dba0a1fb377fde48e157afbf9f354ab | |
| parent | bfd974d65823c5ab4be1a2d0934d7392a5fa3069 (diff) | |
esp32/machine_pin: Fix logic clearing USB_SERIAL_JTAG_USB_PAD_ENABLE.
When we don't use USB JTAG, we want to use the two USB pins (D+/D-) as
GPIO. So, do clear USB_SERIAL_JTAG_USB_PAD_ENABLE when USB SERIAL JTAG is
not enabled
Signed-off-by: Garry W <32130780+garywill@users.noreply.github.com>
Signed-off-by: Angus Gratton <angus@redyak.com.au>
| -rw-r--r-- | ports/esp32/machine_pin.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/esp32/machine_pin.c b/ports/esp32/machine_pin.c index b821abf1f..bb0d40c4d 100644 --- a/ports/esp32/machine_pin.c +++ b/ports/esp32/machine_pin.c @@ -158,12 +158,12 @@ static mp_obj_t machine_pin_obj_init_helper(const machine_pin_obj_t *self, size_ } } - #if CONFIG_IDF_TARGET_ESP32C3 && MICROPY_HW_ESP_USB_SERIAL_JTAG + #if CONFIG_IDF_TARGET_ESP32C3 && !MICROPY_HW_ESP_USB_SERIAL_JTAG if (index == 18 || index == 19) { CLEAR_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_USB_PAD_ENABLE); } #endif - #if CONFIG_IDF_TARGET_ESP32C6 && CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED + #if CONFIG_IDF_TARGET_ESP32C6 && !CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED if (index == 12 || index == 13) { CLEAR_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_USB_PAD_ENABLE); } |
