-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serial readUntil locks if delimiter is not found and rx is full #80
Comments
@finneyj @jamesadevine not sure how to handle this case. What happens when RX gets full and a fiber is waiting on some delimiters? |
I think this is for the user to decide, I.e. wait forever or timeout waitUntil(delimiters, timeout); Default of 0? |
Since MakeCode moved to UF8 support, I ended not using this implementation in MakeCode at all. |
How does that work with serial now then? |
Just doing the same logic on the TS side. https://github.com/Microsoft/pxt-common-packages/blob/master/libs/serial/serial.ts#L53 |
Same problem exists if you do a blocking read on |
If you're going to implement this in ts, pass ASYNC and sleep in the loop. |
ok will do. I am trying the new serial on SAMD21, which board did you test it on? |
Currently 0 boards, my SAMD's are at the office. It should work fine, I was going to test on CPX on A2. |
codal-core/source/driver-models/Serial.cpp
Line 55 in 4aab097
If a fiber is waiting of readUntil and the RX is full, it never receives triggers and the serial is effectively locked.
The text was updated successfully, but these errors were encountered: