mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
Merge pull request #2 from hathach/cr1901-msp430f5529
added void dcd_control_status_complete(uint8_t rhport)
This commit is contained in:
commit
965f3a8f1d
@ -51,7 +51,9 @@
|
||||
// DEVICE CONFIGURATION
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#ifndef CFG_TUD_ENDPOINT0_SIZE
|
||||
#define CFG_TUD_ENDPOINT0_SIZE 64
|
||||
#endif
|
||||
|
||||
//------------- CLASS -------------//
|
||||
|
||||
|
@ -119,6 +119,10 @@ void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr);
|
||||
// clear stall, data toggle is also reset to DATA0
|
||||
void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr);
|
||||
|
||||
// Invoked when a control transfer's status stage is complete.
|
||||
// May help DCD to prepare for next control transfer, this API is optional.
|
||||
void dcd_control_status_complete(uint8_t rhport) TU_ATTR_WEAK;
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Event API
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -129,6 +129,7 @@ bool usbd_control_xfer_cb (uint8_t rhport, uint8_t ep_addr, xfer_result_t result
|
||||
if ( tu_edpt_dir(ep_addr) != _ctrl_xfer.request.bmRequestType_bit.direction )
|
||||
{
|
||||
TU_ASSERT(0 == xferred_bytes);
|
||||
if (dcd_control_status_complete) dcd_control_status_complete(rhport);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -231,5 +231,7 @@ void test_usbd_control_in_zlp(void)
|
||||
dcd_edpt_xfer_ExpectAndReturn(rhport, EDPT_CTRL_OUT, NULL, 0, true);
|
||||
dcd_event_xfer_complete(rhport, EDPT_CTRL_OUT, 0, 0, false);
|
||||
|
||||
dcd_control_status_complete_Expect(rhport);
|
||||
|
||||
tud_task();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user