EOlsen Posted April 29, 2014 Share Posted April 29, 2014 When working with serial I/O does using the ReadUntil function automatically give up a thread's time slice until the next character is received, or do we still need to embed some sort of delay in a code loop continually polling I/O hardware? Link to comment Share on other sites More sharing options...
AzeoTech Posted April 29, 2014 Share Posted April 29, 2014 If there are no characters in the comm buffer, the thread will go to sleep waiting for the characters (up to the timeout value for the port). However, you still should at least put a delay() inside the catch() block if you have one. The reason is that if you, for example, have a typo in your read command and that throws some non-comms related error and the read never happens, you end up with a fast loop. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.