/* * USB Set/Clear Feature Event Callback * Called automatically on USB Set/Clear Feature Request */ #if USB_FEATURE_EVENT void USB_Feature_Event (void) { } #endif #define P_EP(n) ((USB_EP_EVENT & (1 << (n))) ? USB_EndPoint##n : NULL) /* USB Endpoint Events Callback Pointers */ void (* const USB_P_EP[2]) (uint32_t event) = { P_EP(0), P_EP(1), }; /* * 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: SetOutReport(); /* data received from Host */ break; case USB_EVT_IN:
/* * USB Set/Clear Feature Event Callback * Called automatically on USB Set/Clear Feature Request */ #if USB_FEATURE_EVENT void USB_Feature_Event (void) { } #endif #define P_EP(n) ((USB_EP_EVENT & (1 << (n))) ? USB_EndPoint##n : NULL) /* USB Endpoint Events Callback Pointers */ void (* const USB_P_EP[16]) (uint32_t event) = { P_EP(0), P_EP(1), P_EP(2), P_EP(3), P_EP(4), P_EP(5), P_EP(6), P_EP(7), P_EP(8), P_EP(9), P_EP(10), P_EP(11), P_EP(12), P_EP(13), P_EP(14), P_EP(15),
* USB Set/Clear Feature Event Callback * Called automatically on USB Set/Clear Feature Request */ #if USB_FEATURE_EVENT void USB_Feature_Event (void) { } #endif #define P_EP(n) ((USB_EP_EVENT & (1 << (n))) ? USB_EndPoint##n : NULL) /* USB Endpoint Events Callback Pointers */ void (* const USB_P_EP[USB_EP_NUM]) (uint32_t event) = { P_EP(0), P_EP(1), P_EP(2), P_EP(3), P_EP(4), // P_EP(5) }; /* * USB Endpoint 2 Event Callback * Called automatically on USB Endpoint 1 Event * Parameter: event */ void USB_EndPoint2 (uint32_t event)
#endif /* * USB Set/Clear Feature Event Callback * Called automatically on USB Set/Clear Feature Request */ #if USB_FEATURE_EVENT void USB_Feature_Event (void) { } #endif #define P_EP(n) ((USB_EP_EVENT & (1 << (n))) ? USB_EndPoint##n : NULL) /* USB Endpoint Events Callback Pointers */ void (* const USB_P_EP[USB_LOGIC_EP_NUM])(uint32_t event) = { P_EP(0), P_EP(1), P_EP(2), P_EP(3), P_EP(4), }; /* * 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: