usbuart: Don't try to send until configured. Enumeration may hang else

This commit is contained in:
Uwe Bonnes 2013-02-15 17:55:36 +01:00
parent dee82a0d4f
commit ff8de39774
1 changed files with 6 additions and 0 deletions

View File

@ -126,6 +126,12 @@ void USBUSART_ISR(void)
{
char c = usart_recv(USBUSART);
/* Don't try to write until we are configured.
* Otherwise enumeration hanged in some cases.
*/
if (cdcacm_get_config() != 1)
return;
gpio_set(LED_PORT_UART, LED_UART);
/* Try to send now */