|
|
@ -117,34 +117,52 @@ void EVENT_USB_Disconnect(void)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void EVENT_USB_ConfigurationChanged(void)
|
|
|
|
void EVENT_USB_ConfigurationChanged(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Indicate USB connected and ready */
|
|
|
|
|
|
|
|
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
|
|
|
|
|
|
|
|
|
|
|
/* Setup CDC Notification, Rx and Tx Endpoints for the first CDC */
|
|
|
|
/* Setup CDC Notification, Rx and Tx Endpoints for the first CDC */
|
|
|
|
Endpoint_ConfigureEndpoint(CDC1_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
|
|
|
|
if (!(Endpoint_ConfigureEndpoint(CDC1_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
|
|
|
|
ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
|
|
|
|
ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
|
|
|
|
ENDPOINT_BANK_SINGLE);
|
|
|
|
ENDPOINT_BANK_SINGLE)))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Endpoint_ConfigureEndpoint(CDC1_TX_EPNUM, EP_TYPE_BULK,
|
|
|
|
if (!(Endpoint_ConfigureEndpoint(CDC1_TX_EPNUM, EP_TYPE_BULK,
|
|
|
|
ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
|
|
|
|
ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
|
|
|
|
ENDPOINT_BANK_SINGLE);
|
|
|
|
ENDPOINT_BANK_SINGLE)))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Endpoint_ConfigureEndpoint(CDC1_RX_EPNUM, EP_TYPE_BULK,
|
|
|
|
if (!(Endpoint_ConfigureEndpoint(CDC1_RX_EPNUM, EP_TYPE_BULK,
|
|
|
|
ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
|
|
|
|
ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
|
|
|
|
ENDPOINT_BANK_SINGLE);
|
|
|
|
ENDPOINT_BANK_SINGLE)))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Setup CDC Notification, Rx and Tx Endpoints for the second CDC */
|
|
|
|
/* Setup CDC Notification, Rx and Tx Endpoints for the second CDC */
|
|
|
|
Endpoint_ConfigureEndpoint(CDC2_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
|
|
|
|
if (!(Endpoint_ConfigureEndpoint(CDC2_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,
|
|
|
|
ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
|
|
|
|
ENDPOINT_DIR_IN, CDC_NOTIFICATION_EPSIZE,
|
|
|
|
ENDPOINT_BANK_SINGLE);
|
|
|
|
ENDPOINT_BANK_SINGLE)))
|
|
|
|
|
|
|
|
{
|
|
|
|
Endpoint_ConfigureEndpoint(CDC2_TX_EPNUM, EP_TYPE_BULK,
|
|
|
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
|
|
|
ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
|
|
|
|
}
|
|
|
|
ENDPOINT_BANK_SINGLE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Endpoint_ConfigureEndpoint(CDC2_RX_EPNUM, EP_TYPE_BULK,
|
|
|
|
if (!(Endpoint_ConfigureEndpoint(CDC2_TX_EPNUM, EP_TYPE_BULK,
|
|
|
|
ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
|
|
|
|
ENDPOINT_DIR_IN, CDC_TXRX_EPSIZE,
|
|
|
|
ENDPOINT_BANK_SINGLE);
|
|
|
|
ENDPOINT_BANK_SINGLE)))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Indicate USB connected and ready */
|
|
|
|
if (!(Endpoint_ConfigureEndpoint(CDC2_RX_EPNUM, EP_TYPE_BULK,
|
|
|
|
LEDs_SetAllLEDs(LEDMASK_USB_READY);
|
|
|
|
ENDPOINT_DIR_OUT, CDC_TXRX_EPSIZE,
|
|
|
|
|
|
|
|
ENDPOINT_BANK_SINGLE)))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
|
|
|
|
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
|
|
|
|