From ddc3c2b78be402c037835aca2d350dc8f4067832 Mon Sep 17 00:00:00 2001 From: Peter Marcisovsky Date: Tue, 16 Jul 2024 11:32:22 +0200 Subject: [PATCH] refactor(usb_host): Update USB Host multiconfig public API - previous usb_host_get_config_desc_free() - updated usb_host_free_config_desc() --- components/usb/include/usb/usb_host.h | 4 ++-- .../usb/test_apps/usb_host/main/multiconf_client_async.c | 2 +- components/usb/usb_host.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/usb/include/usb/usb_host.h b/components/usb/include/usb/usb_host.h index 823a42b158..b9a1c4dabb 100644 --- a/components/usb/include/usb/usb_host.h +++ b/components/usb/include/usb/usb_host.h @@ -352,7 +352,7 @@ esp_err_t usb_host_get_active_config_descriptor(usb_device_handle_t dev_hdl, con * - The USB Host library only caches a device's active configuration descriptor. * - This function reads any configuration descriptor of a particular device (specified by bConfigurationValue). * - This function will read the specified configuration descriptor via control transfers, and allocate memory to store that descriptor. - * - Users can call usb_host_get_config_desc_free() to free the descriptor's memory afterwards. + * - Users can call usb_host_free_config_desc() to free the descriptor's memory afterwards. * * @note This function can block * @note A client must call usb_host_device_open() on the device first @@ -373,7 +373,7 @@ esp_err_t usb_host_get_config_desc(usb_host_client_handle_t client_hdl, usb_devi * @param[out] config_desc Configuration descriptor * @return esp_err_t */ -esp_err_t usb_host_get_config_desc_free(const usb_config_desc_t *config_desc); +esp_err_t usb_host_free_config_desc(const usb_config_desc_t *config_desc); // ----------------------------------------------- Interface Functions ------------------------------------------------- diff --git a/components/usb/test_apps/usb_host/main/multiconf_client_async.c b/components/usb/test_apps/usb_host/main/multiconf_client_async.c index 26e67069a9..811a1dbdc1 100644 --- a/components/usb/test_apps/usb_host/main/multiconf_client_async.c +++ b/components/usb/test_apps/usb_host/main/multiconf_client_async.c @@ -146,7 +146,7 @@ void multiconf_client_async_task(void *arg) TEST_ASSERT_EQUAL_MEMORY_MESSAGE(config_desc_ref, multiconf_obj.config_desc_cached, sizeof(usb_config_desc_t), "Configuration descriptors do not match"); // Free the memory used to store the config descriptor - TEST_ASSERT_EQUAL(ESP_OK, usb_host_get_config_desc_free(multiconf_obj.config_desc_cached)); + TEST_ASSERT_EQUAL(ESP_OK, usb_host_free_config_desc(multiconf_obj.config_desc_cached)); multiconf_obj.next_stage = TEST_STAGE_DEV_CLOSE; skip_event_handling = true; break; diff --git a/components/usb/usb_host.c b/components/usb/usb_host.c index 9bbf31c19d..2f5dc6fbed 100644 --- a/components/usb/usb_host.c +++ b/components/usb/usb_host.c @@ -1173,7 +1173,7 @@ exit: return ret; } -esp_err_t usb_host_get_config_desc_free(const usb_config_desc_t *config_desc) +esp_err_t usb_host_free_config_desc(const usb_config_desc_t *config_desc) { HOST_CHECK(config_desc != NULL, ESP_ERR_INVALID_ARG); heap_caps_free((usb_config_desc_t*)config_desc);