Skip to content

Commit 5efef43

Browse files
committed
Hub: Expand hub helpers to handle device events
1 parent 8a28e7c commit 5efef43

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/host/hub.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ bool hub_port_clear_feature(uint8_t hub_addr, uint8_t hub_port, uint8_t feature,
8585
{
8686
.bmRequestType_bit =
8787
{
88-
.recipient = TUSB_REQ_RCPT_OTHER,
88+
.recipient = (hub_port == 0) ? TUSB_REQ_RCPT_DEVICE : TUSB_REQ_RCPT_OTHER,
8989
.type = TUSB_REQ_TYPE_CLASS,
9090
.direction = TUSB_DIR_OUT
9191
},
@@ -117,7 +117,7 @@ bool hub_port_set_feature(uint8_t hub_addr, uint8_t hub_port, uint8_t feature,
117117
{
118118
.bmRequestType_bit =
119119
{
120-
.recipient = TUSB_REQ_RCPT_OTHER,
120+
.recipient = (hub_port == 0) ? TUSB_REQ_RCPT_DEVICE : TUSB_REQ_RCPT_OTHER,
121121
.type = TUSB_REQ_TYPE_CLASS,
122122
.direction = TUSB_DIR_OUT
123123
},
@@ -149,7 +149,7 @@ bool hub_port_get_status(uint8_t hub_addr, uint8_t hub_port, void* resp,
149149
{
150150
.bmRequestType_bit =
151151
{
152-
.recipient = TUSB_REQ_RCPT_OTHER,
152+
.recipient = (hub_port == 0) ? TUSB_REQ_RCPT_DEVICE : TUSB_REQ_RCPT_OTHER,
153153
.type = TUSB_REQ_TYPE_CLASS,
154154
.direction = TUSB_DIR_IN
155155
},

0 commit comments

Comments
 (0)