diff options
| author | hathach <[email protected]> | 2021-02-11 11:22:02 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2021-02-11 11:22:02 +0700 |
| commit | 49bc97b0caf65f4e850846f03c8693bb49198172 (patch) | |
| tree | b3c5e7977babbd9ff055c45ba40e1186395ec93b /src/device/usbd_control.c | |
| parent | ba11bb2b80e11f130f5383d733a5529ca4dabdb4 (diff) | |
remove the requirement of std SET/CLEAR_FEATURE must not return zlp status
Diffstat (limited to 'src/device/usbd_control.c')
| -rw-r--r-- | src/device/usbd_control.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/device/usbd_control.c b/src/device/usbd_control.c index 8ed0ad1c0..d15380199 100644 --- a/src/device/usbd_control.c +++ b/src/device/usbd_control.c @@ -67,12 +67,7 @@ static inline bool _status_stage_xact(uint8_t rhport, tusb_control_request_t con { // Opposite to endpoint in Data Phase uint8_t const ep_addr = request->bmRequestType_bit.direction ? EDPT_CTRL_OUT : EDPT_CTRL_IN; - - TU_LOG2(" Queue EP %02X with zlp Status\r\n", ep_addr); - - // status direction is reversed to one in the setup packet - // Note: Status must always be DATA1 - return dcd_edpt_xfer(rhport, ep_addr, NULL, 0); + return usbd_edpt_xfer(rhport, ep_addr, NULL, 0); } // Status phase @@ -101,9 +96,7 @@ static bool _data_stage_xact(uint8_t rhport) if ( xact_len ) memcpy(_usbd_ctrl_buf, _ctrl_xfer.buffer, xact_len); } - TU_LOG2(" Queue EP %02X with %u bytes\r\n", ep_addr, xact_len); - - return dcd_edpt_xfer(rhport, ep_addr, xact_len ? _usbd_ctrl_buf : NULL, xact_len); + return usbd_edpt_xfer(rhport, ep_addr, xact_len ? _usbd_ctrl_buf : NULL, xact_len); } // Transmit data to/from the control endpoint. @@ -140,9 +133,6 @@ bool tud_control_xfer(uint8_t rhport, tusb_control_request_t const * request, vo // USBD API //--------------------------------------------------------------------+ -//--------------------------------------------------------------------+ -// Prototypes -//--------------------------------------------------------------------+ void usbd_control_reset(void); void usbd_control_set_request(tusb_control_request_t const *request); void usbd_control_set_complete_callback( usbd_control_xfer_cb_t fp ); @@ -153,13 +143,13 @@ void usbd_control_reset(void) tu_varclr(&_ctrl_xfer); } -// TODO may find a better way +// Set complete callback void usbd_control_set_complete_callback( usbd_control_xfer_cb_t fp ) { _ctrl_xfer.complete_cb = fp; } -// useful for dcd_set_address where DCD is responsible for status response +// for dcd_set_address where DCD is responsible for status response void usbd_control_set_request(tusb_control_request_t const *request) { _ctrl_xfer.request = (*request); |
