Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe the PR
This pull request introduces several updates to improve USB host functionality, enhance clarity in the codebase, and add new features. Key changes include the addition of callback interception for port status handling, the introduction of local status retrieval, and various refactorings for consistency and maintainability.
USB Host Enhancements:
hub_port_get_status
to save port status locally before invoking the user callback. This allows for efficient status handling without requiring the user to process raw responses. (src/host/hub.c
, [1] [2]hub_port_get_status_local
, to retrieve port status from a local cache instead of sending a request to the device. (src/host/hub.c
, [1];src/host/hub.h
, [2]Refactoring and Code Simplification:
dev_addr
withdaddr
across multiple functions for consistency with existing naming conventions. (src/host/hub.c
, [1] [2];src/host/hub.h
, [3]process_new_status
function to consolidate and streamline the handling of hub and port status changes, replacing multiple redundant functions. (src/host/hub.c
, [1] [2]Descriptor and Device Information Updates:
usbh_device_t
for clarity, including changingvid
/pid
toidVendor
/idProduct
and other descriptor fields to match USB specification naming. (src/host/usbh.c
, [1] [2] [3]tuh_address_set
, to support setting a new USB device address via a standard control transfer. (src/host/usbh.c
, src/host/usbh.cR1143-R1169)Miscellaneous Improvements:
hub_port_get_status
. (src/host/hub.h
, [1] [2]_usbh_data.enumerating_daddr
reset intuh_task_ext
. (src/host/usbh.c
, src/host/usbh.cL539)