refactor(usb_host): Update USB Host multiconfig public API

- previous usb_host_get_config_desc_free()
    - updated usb_host_free_config_desc()
This commit is contained in:
Peter Marcisovsky 2024-07-16 11:32:22 +02:00
parent fb1a8461f7
commit ddc3c2b78b
3 changed files with 4 additions and 4 deletions

View File

@ -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 -------------------------------------------------

View File

@ -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;

View File

@ -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);