From 617a608027b6abc4fa3ff55cb8c9813b1f1c80fa Mon Sep 17 00:00:00 2001 From: Tomas Rezucha Date: Fri, 19 Sep 2025 14:12:53 +0200 Subject: [PATCH] fix(usb/host): Use ESP_INTR_FLAG_LOWMED interrupt priority for USB examples --- .../usb/host/cdc/cdc_acm_host/main/usb_cdc_example_main.c | 4 ++-- .../host/cdc/cdc_acm_vcp/main/cdc_acm_vcp_example_main.cpp | 4 ++-- examples/peripherals/usb/host/hid/main/hid_host_example.c | 4 ++-- examples/peripherals/usb/host/msc/main/msc_example_main.c | 4 ++-- .../usb/host/usb_host_lib/main/usb_host_lib_main.c | 6 +++--- examples/peripherals/usb/host/uvc/main/main.c | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/peripherals/usb/host/cdc/cdc_acm_host/main/usb_cdc_example_main.c b/examples/peripherals/usb/host/cdc/cdc_acm_host/main/usb_cdc_example_main.c index f8c548e01a..22d9cce080 100644 --- a/examples/peripherals/usb/host/cdc/cdc_acm_host/main/usb_cdc_example_main.c +++ b/examples/peripherals/usb/host/cdc/cdc_acm_host/main/usb_cdc_example_main.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: CC0-1.0 */ @@ -109,7 +109,7 @@ void app_main(void) ESP_LOGI(TAG, "Installing USB Host"); const usb_host_config_t host_config = { .skip_phy_setup = false, - .intr_flags = ESP_INTR_FLAG_LEVEL1, + .intr_flags = ESP_INTR_FLAG_LOWMED, }; ESP_ERROR_CHECK(usb_host_install(&host_config)); diff --git a/examples/peripherals/usb/host/cdc/cdc_acm_vcp/main/cdc_acm_vcp_example_main.cpp b/examples/peripherals/usb/host/cdc/cdc_acm_vcp/main/cdc_acm_vcp_example_main.cpp index 32d2fee7e3..b21a4f7758 100644 --- a/examples/peripherals/usb/host/cdc/cdc_acm_vcp/main/cdc_acm_vcp_example_main.cpp +++ b/examples/peripherals/usb/host/cdc/cdc_acm_vcp/main/cdc_acm_vcp_example_main.cpp @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: CC0-1.0 */ @@ -111,7 +111,7 @@ extern "C" void app_main(void) ESP_LOGI(TAG, "Installing USB Host"); usb_host_config_t host_config = {}; host_config.skip_phy_setup = false; - host_config.intr_flags = ESP_INTR_FLAG_LEVEL1; + host_config.intr_flags = ESP_INTR_FLAG_LOWMED; ESP_ERROR_CHECK(usb_host_install(&host_config)); // Create a task that will handle USB library events diff --git a/examples/peripherals/usb/host/hid/main/hid_host_example.c b/examples/peripherals/usb/host/hid/main/hid_host_example.c index 29d016c462..eb3090a45c 100644 --- a/examples/peripherals/usb/host/hid/main/hid_host_example.c +++ b/examples/peripherals/usb/host/hid/main/hid_host_example.c @@ -557,7 +557,7 @@ static void usb_lib_task(void *arg) { const usb_host_config_t host_config = { .skip_phy_setup = false, - .intr_flags = ESP_INTR_FLAG_LEVEL1, + .intr_flags = ESP_INTR_FLAG_LOWMED, }; ESP_ERROR_CHECK(usb_host_install(&host_config)); @@ -645,7 +645,7 @@ void app_main(void) .intr_type = GPIO_INTR_NEGEDGE, }; ESP_ERROR_CHECK(gpio_config(&input_pin)); - ESP_ERROR_CHECK(gpio_install_isr_service(ESP_INTR_FLAG_LEVEL1)); + ESP_ERROR_CHECK(gpio_install_isr_service(ESP_INTR_FLAG_LOWMED)); ESP_ERROR_CHECK(gpio_isr_handler_add(APP_QUIT_PIN, gpio_isr_cb, NULL)); /* diff --git a/examples/peripherals/usb/host/msc/main/msc_example_main.c b/examples/peripherals/usb/host/msc/main/msc_example_main.c index 8b5a9143f3..4f66e12143 100644 --- a/examples/peripherals/usb/host/msc/main/msc_example_main.c +++ b/examples/peripherals/usb/host/msc/main/msc_example_main.c @@ -421,7 +421,7 @@ static void speed_test(int slot) */ static void usb_task(void *args) { - const usb_host_config_t host_config = { .intr_flags = ESP_INTR_FLAG_LEVEL1 }; + const usb_host_config_t host_config = { .intr_flags = ESP_INTR_FLAG_LOWMED }; ESP_ERROR_CHECK(usb_host_install(&host_config)); const msc_host_driver_config_t msc_config = { @@ -508,7 +508,7 @@ void app_main(void) .intr_type = GPIO_INTR_NEGEDGE, }; ESP_ERROR_CHECK(gpio_config(&input_pin)); - ESP_ERROR_CHECK(gpio_install_isr_service(ESP_INTR_FLAG_LEVEL1)); + ESP_ERROR_CHECK(gpio_install_isr_service(ESP_INTR_FLAG_LOWMED)); ESP_ERROR_CHECK(gpio_isr_handler_add(APP_QUIT_PIN, gpio_cb, NULL)); ESP_LOGI(TAG, "Waiting for USB flash drive to be connected"); diff --git a/examples/peripherals/usb/host/usb_host_lib/main/usb_host_lib_main.c b/examples/peripherals/usb/host/usb_host_lib/main/usb_host_lib_main.c index 8c8043440d..fbea4b7443 100644 --- a/examples/peripherals/usb/host/usb_host_lib/main/usb_host_lib_main.c +++ b/examples/peripherals/usb/host/usb_host_lib/main/usb_host_lib_main.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ @@ -109,7 +109,7 @@ static void usb_host_lib_task(void *arg) ESP_LOGI(TAG, "Installing USB Host Library"); usb_host_config_t host_config = { .skip_phy_setup = false, - .intr_flags = ESP_INTR_FLAG_LEVEL1, + .intr_flags = ESP_INTR_FLAG_LOWMED, # ifdef ENABLE_ENUM_FILTER_CALLBACK .enum_filter_cb = set_config_cb, # endif // ENABLE_ENUM_FILTER_CALLBACK @@ -161,7 +161,7 @@ void app_main(void) .intr_type = GPIO_INTR_NEGEDGE, }; ESP_ERROR_CHECK(gpio_config(&input_pin)); - ESP_ERROR_CHECK(gpio_install_isr_service(ESP_INTR_FLAG_LEVEL1)); + ESP_ERROR_CHECK(gpio_install_isr_service(ESP_INTR_FLAG_LOWMED)); ESP_ERROR_CHECK(gpio_isr_handler_add(APP_QUIT_PIN, gpio_cb, NULL)); app_event_queue = xQueueCreate(10, sizeof(app_event_queue_t)); diff --git a/examples/peripherals/usb/host/uvc/main/main.c b/examples/peripherals/usb/host/uvc/main/main.c index 60edd7326b..d830a015f4 100644 --- a/examples/peripherals/usb/host/uvc/main/main.c +++ b/examples/peripherals/usb/host/uvc/main/main.c @@ -211,7 +211,7 @@ void app_main(void) ESP_LOGI(TAG, "Installing USB Host"); const usb_host_config_t host_config = { .skip_phy_setup = false, - .intr_flags = ESP_INTR_FLAG_LEVEL1, + .intr_flags = ESP_INTR_FLAG_LOWMED, }; ESP_ERROR_CHECK(usb_host_install(&host_config));