Browse Source

add fix so that if it's busy we wait and try again...

mbed-sx1276
John-Mark Gurney 3 years ago
parent
commit
319e499b68
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      stm32/usb/usbd_cdc_if.c

+ 7
- 1
stm32/usb/usbd_cdc_if.c View File

@@ -315,7 +315,13 @@ void usb_printf(const char *format, ...)
va_start(args, format);
length = vsnprintf((char *)UserTxBufferFS, APP_TX_DATA_SIZE, (char *)format, args);
va_end(args);
CDC_Transmit_FS(UserTxBufferFS, length);
for (;;) {
if (CDC_Transmit_FS(UserTxBufferFS, length) == USBD_BUSY) {
HAL_Delay(1);
continue;
}
break;
}
}
/* USER CODE END PRIVATE_FUNCTIONS_IMPLEMENTATION */



Loading…
Cancel
Save