[SAM] CDC working. (workaround implemented for Windows previous issue)

This commit is contained in:
Thibault RICHARD 2012-05-09 12:45:14 +02:00
parent d6d23c530a
commit 4d59afcc64
3 changed files with 5 additions and 4 deletions

View File

@ -425,17 +425,15 @@ static void USB_ISR(void)
uint8_t requestType = setup.bmRequestType; uint8_t requestType = setup.bmRequestType;
if (requestType & REQUEST_DEVICETOHOST) if (requestType & REQUEST_DEVICETOHOST)
{ {
TRACE_CORE(printf(">>> EP0 Int: IN Request\r\n");) TRACE_CORE(puts(">>> EP0 Int: IN Request\r\n");)
UDD_WaitIN(); UDD_WaitIN();
} }
else else
{ {
TRACE_CORE(printf(">>> EP0 Int: OUT Request\r\n");) TRACE_CORE(puts(">>> EP0 Int: OUT Request\r\n");)
UDD_ClearIN(); UDD_ClearIN();
} }
bool ok = true ; bool ok = true ;
if (REQUEST_STANDARD == (requestType & REQUEST_TYPE)) if (REQUEST_STANDARD == (requestType & REQUEST_TYPE))
{ {
@ -507,6 +505,9 @@ static void USB_ISR(void)
else else
{ {
TRACE_CORE(puts(">>> EP0 Int: ClassInterfaceRequest\r\n");) TRACE_CORE(puts(">>> EP0 Int: ClassInterfaceRequest\r\n");)
UDD_WaitIN(); // Workaround: need tempo here, else CDC serial won't open correctly
USBD_InitControl(setup.wLength); // Max length of transfer USBD_InitControl(setup.wLength); // Max length of transfer
ok = USBD_ClassInterfaceRequest(setup); ok = USBD_ClassInterfaceRequest(setup);
} }