- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The sample code suggests code like this...
/* Wait until component is ready to send data to host. */
while (0u == USBUART_CDCIsReady())
{
}
Is it possible to get stuck in this loop if there is a problem with the USB connection?
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Welcome in the forum!
You can get stuck depending on the state of the USBUART.
I would suggest you to modify one of the example projects for your need. Right click on the USBUART component (on your topdesign or in component catalog) and select "Find Code Example".
Happy coding
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is the example code for USBFS_UART. Is there another example project?
Can a timer be used as a way to get unstuck? What is a reasonable duration?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does the unmodified example project get stuck in USBFS-UART?
What changes did you exactly make?
Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, this is a misunderstanding.
The while-loop you questioned in your first post will indeed wait until the connection is OK. In a real project you may of course try it only once and ask to connect when failed. But how to "ask" when using a prototyping kit? (Light an LED, try in a while until OK, then switch off the LED.) You cannot proceed with the project when the USB connection is not established.
Bob