Skip to content

Commit f5cffee

Browse files
committed
Fix typo in audio.h. Specifiy _ctrl_xfer struct in CFG_TUSB_MEM_SECTION
Add NULL check to loop in list_remove_qhd_by_addr() function in ehci.c
1 parent 549bee9 commit f5cffee

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/class/audio/audio.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,11 +721,13 @@ typedef struct TU_ATTR_PACKED
721721
uint8_t bLength ; ///< Size of this descriptor, in bytes: 17.
722722
uint8_t bDescriptorType ; ///< Descriptor Type. Value: TUSB_DESC_CS_INTERFACE.
723723
uint8_t bDescriptorSubType ; ///< Descriptor SubType. Value: AUDIO_CS_AC_INTERFACE_INPUT_TERMINAL.
724+
uint8_t bTerminalID ; ///< Constant uniquely identifying the Terminal within the audio function. This value is used in all requests to address this terminal.
724725
uint16_t wTerminalType ; ///< Constant characterizing the type of Terminal. See: audio_terminal_type_t for USB streaming and audio_terminal_input_type_t for other input types.
725726
uint8_t bAssocTerminal ; ///< ID of the Output Terminal to which this Input Terminal is associated.
726727
uint8_t bCSourceID ; ///< ID of the Clock Entity to which this Input Terminal is connected.
727728
uint8_t bNrChannels ; ///< Number of logical output channels in the Terminal’s output audio channel cluster.
728729
uint32_t bmChannelConfig ; ///< Describes the spatial location of the logical channels. See:audio_channel_config_t.
730+
uint8_t iChannelNames ; ///< Index of a string descriptor, describing the name of the first logical channel.
729731
uint16_t bmControls ; ///< See: audio_terminal_input_control_pos_t.
730732
uint8_t iTerminal ; ///< Index of a string descriptor, describing the Input Terminal.
731733
} audio_desc_input_terminal_t;

src/host/usbh.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ static osal_queue_t _usbh_q;
229229
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN
230230
static uint8_t _usbh_ctrl_buf[CFG_TUH_ENUMERATION_BUFSIZE];
231231

232-
// Control transfer: since most controller does not support multiple control transfer
233-
// on multiple devices concurrently. And control transfer is not used much except enumeration
234-
// We will only execute control transfer one at a time.
235-
struct
232+
// Control transfers: since most controllers do not support multiple control transfers
233+
// on multiple devices concurrently and control transfers are not used much except for
234+
// enumeration, we will only execute control transfers one at a time.
235+
CFG_TUSB_MEM_SECTION struct
236236
{
237237
tusb_control_request_t request TU_ATTR_ALIGNED(4);
238238
uint8_t* buffer;

src/portable/ehci/ehci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ tusb_speed_t hcd_port_speed_get(uint8_t rhport)
188188
static void list_remove_qhd_by_addr(ehci_link_t* list_head, uint8_t dev_addr)
189189
{
190190
for(ehci_link_t* prev = list_head;
191-
!prev->terminate && (tu_align32(prev->address) != (uint32_t) list_head);
191+
!prev->terminate && (tu_align32(prev->address) != (uint32_t) list_head) && prev != NULL;
192192
prev = list_next(prev) )
193193
{
194194
// TODO check type for ISO iTD and siTD

0 commit comments

Comments
 (0)