Skip to content

Commit 4d2d60d

Browse files
garywilldpgeorge
authored andcommitted
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 <[email protected]> Signed-off-by: Angus Gratton <[email protected]>
1 parent bfd974d commit 4d2d60d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: ports/esp32/machine_pin.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ static mp_obj_t machine_pin_obj_init_helper(const machine_pin_obj_t *self, size_
158158
}
159159
}
160160

161-
#if CONFIG_IDF_TARGET_ESP32C3 && MICROPY_HW_ESP_USB_SERIAL_JTAG
161+
#if CONFIG_IDF_TARGET_ESP32C3 && !MICROPY_HW_ESP_USB_SERIAL_JTAG
162162
if (index == 18 || index == 19) {
163163
CLEAR_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_USB_PAD_ENABLE);
164164
}
165165
#endif
166-
#if CONFIG_IDF_TARGET_ESP32C6 && CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED
166+
#if CONFIG_IDF_TARGET_ESP32C6 && !CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED
167167
if (index == 12 || index == 13) {
168168
CLEAR_PERI_REG_MASK(USB_SERIAL_JTAG_CONF0_REG, USB_SERIAL_JTAG_USB_PAD_ENABLE);
169169
}

0 commit comments

Comments
 (0)