示例#1
0
/*
 *  USB Endpoint 1 Event Callback
 *   Called automatically on USB Endpoint 1 Event
 *    Parameter:       event
 */
void USB_EndPoint1(uint32_t event) {
	switch (event) {
	case USB_EVT_OUT:
		USB_ReadEP(USB_ENDPOINT_OUT(1), OUT1Packet);
		lasershark_process_command();
		USB_WriteEP(USB_ENDPOINT_IN(1), IN1Packet, 64);
		break;
	case USB_EVT_IN:
		break;
	}
}
/*
 *  USB Endpoint 1 Event Callback
 *   Called automatically on USB Endpoint 1 Event
 *    Parameter:       event
 */
ErrorCode_t USB_EndPoint1(USBD_HANDLE_T hUsb, void* data, uint32_t event) {
	switch (event) {
	case USB_EVT_OUT:
		pUsbApi->hw->ReadEP(hUsb, USB_ENDPOINT_OUT(1), OUT1Packet);
		lasershark_process_command();
		pUsbApi->hw->WriteEP(hUsb, USB_ENDPOINT_IN(1), IN1Packet, 64);
		break;
	case USB_EVT_IN:
		break;
	}

	return LPC_OK;
}