esp32: Fix ESP32-C3 USB serial/jtag peripheral pre-IDF 5.1.

Regression in 0a11832cd in IDF 5.0.x where macro
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED is not defined.

With this patch, ESP32-S3 still USB Serial/JTAG incorrectly (now on all
ESP-IDF versions).

Closes #15701

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit is contained in:
Angus Gratton
2024-08-27 15:49:43 +10:00
parent 1897fe6227
commit 6ad6297ef7
8 changed files with 16 additions and 11 deletions

View File

@@ -159,7 +159,7 @@ static mp_obj_t machine_pin_obj_init_helper(const machine_pin_obj_t *self, size_
}
}
#if CONFIG_IDF_TARGET_ESP32C3 && CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED
#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);
}