added optional dcd_control_status_complete()
This commit is contained in:
		| @@ -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(); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 hathach
					hathach