nedd for Delay between CDC_Transmit_FS calling
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-09-04 5:22 AM
Posted on September 04, 2015 at 14:22
I have this code:
while (1)
{
if(fUSB_rcv)
{
CDC_Transmit_FS((uint8_t *)''Mensaje Recibido\n\r'', 18);
HAL_Delay(10);
if (msg[0]=='L' && msg[1]=='E' && msg[2]=='O' && msg[3]=='1')
{
CDC_Transmit_FS((uint8_t *)''Mensaje Correcto\n\r'', 18);
}
else
{
CDC_Transmit_FS((uint8_t *)''Mensaje Incorrecto\n\r'', 20);
}
fUSB_rcv=0;
}
}
static int8_t CDC_Receive_FS (uint8_t* Buf, uint32_t *Len)
{
/* USER CODE BEGIN 6 */
char i = 0;
fUSB_rcv=1;
for (i = 0; i < *Len; i++)
msg[i] = *(Buf + i);
USBD_CDC_ReceivePacket(&hUsbDeviceFS);
return (USBD_OK);
/* USER CODE END 6 */
}
I would like to remove HAL_Delay before
CDC_Transmit_FS((uint8_t *)''Mensaje Recibido\n\r'', 18);
If I remove that delay, the second msg (Message Correct or Incorrect) is not received on PC side.
Is there a macro or a function to check before the second CDC_Transmit_FS calling?
regards
#usb #cdc #device
Labels:
- Labels:
-
USB
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-04-05 10:16 AM
Posted on April 05, 2016 at 19:16
Hi elgarbe
,
You can manage several CDC_Transmit calls based on the USBH_CDC_TransmitCallback. In this callback function, you can call the CDC_Transmit functions as it is done in the example STM32Cube_FW_F4_V1.8.0\Projects\STM324xG_EVAL\Applications\USB_Host\CDC_Standalone (have a look to the implementation in Src/cdc_send.c). -Hannibal-Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-04-07 1:43 PM
Posted on April 07, 2016 at 22:43
> Is there a macro or a function to check before the second CDC_Transmit_FS calling?
discussed on this topic, recently Tsuneo