/* Handle complete OUT transfer on EP0. 
Handles the OUT packet based on the state of endpoint 0. Starts a new read for new SETUP packets, when in OUT_STATUS. When endpoint 0 is in OUT_DATA state, it handles the received data and starts a write transaction for IN_STATUS.  */
void USBD_HandleEP0_OUT()
/* Handle complete OUT transfer on EP0. 
Handles the OUT packet based on the state of endpoint 0. Starts a new read for new SETUP packets, when in OUT_STATUS. When endpoint 0 is in OUT_DATA state, it handles the received data and starts a write transaction for IN_STATUS.  */
void USBD_HandleEP0_OUT()
{
		USB_Device_ProcessControlRequest();
		device.Driver->EndpointWrite(ENDPOINT_DIR_MASK & 0,0,0);
		device.EP0_State = IN_STATUS;
	}
	if (device.EP0_State == OUT_STATUS) {
		device.Driver->EndpointReadStart(device.Endpoints[0].Address,24);
		device.EP0_State = IDLE;
	}
}