Merge pull request #271 from majbthrd/nucoutmps
nuc121: fix handling of OUT transfers larger than max packet size
This commit is contained in:
		| @@ -395,9 +395,11 @@ void USBD_IRQHandler(void) | |||||||
|           xfer->remaining_bytes -= available_bytes; |           xfer->remaining_bytes -= available_bytes; | ||||||
|           xfer->data_ptr += available_bytes; |           xfer->data_ptr += available_bytes; | ||||||
|  |  | ||||||
|           /* when the transfer is finished, alert TinyUSB */ |           /* when the transfer is finished, alert TinyUSB; otherwise, accept more data */ | ||||||
|           if ( (0 == xfer->remaining_bytes) || (available_bytes < xfer->max_packet_size) ) |           if ( (0 == xfer->remaining_bytes) || (available_bytes < xfer->max_packet_size) ) | ||||||
|             dcd_event_xfer_complete(0, ep_addr, available_bytes, XFER_RESULT_SUCCESS, true); |             dcd_event_xfer_complete(0, ep_addr, xfer->total_bytes, XFER_RESULT_SUCCESS, true); | ||||||
|  |           else if (xfer->remaining_bytes) | ||||||
|  |             ep->MXPLD = xfer->max_packet_size; | ||||||
|         } |         } | ||||||
|         else |         else | ||||||
|         { |         { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 majbthrd
					majbthrd