-
Notifications
You must be signed in to change notification settings - Fork 56
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.available() does not work on CH32x035 #142
Comments
Hi, this is because it hasn't been implemented (yet). For my CH32V003 projects I've implemented interrupt driven Serial1. Because I only have the v003 I couldn't test any other CH32 chips. Perhaps you want to test this? To test it shoukd be sufficient to replace these two files:
Would be nice if it also works for the CH32x035, but I have not examined that, so no guarantees.... |
it works for CH32x035, I'm tested |
Good to read that CH32x035 works too. A moment ago I submitted PR #145 to add working Serial.available(), Serial.peek() and improve Serial.read(). Would be nice if that PR could also be tested for other CH32 chips. |
its work for CH32V208WB. tested. |
@atollminsk - Excellent. Thank you for testing. |
I checked today with CH32V203C8T6 - it works. CH32V307VCT6 - it doesn't work. |
@atollminsk - thank you for your additional testing. Unfortunately I don't have a CH32V307VCT6 so I cannot do further analysis/debugging. |
@atollminsk - Hmm... So you have tested it working now? |
@maxint-rd Yes, i used to pinMode pin also for Serial. working with CH32V307) |
Serial.available() does not work with the CH32V003 either, but Serial.read() returns a 16 bit -1 value if no byte is pending in the serial port. This is a workaround, but I hope this bug is fixed soon! |
I already fixed it. See earlier comments and PR #145. That PR also improves Serial.read() to prevent lost data when doing other stuff. (It re-introduces the read-buffer). Works for CH32V003, X035, V203, V208, V307 and perhaps others as well. |
Great! |
@blopa1961 - when you open PR #145 you see several tabs. The rightmost lists the files that were changed. In this case two files changed. Please note that PR #145 has not been merged yet, so just cloning the master branch won't give you these changed files. Also review the other PR's to see if there is anything you need. |
Hi everyone, when I call Serial.available() to see if there is any data in the reception buffer, it always returns -1.
The text was updated successfully, but these errors were encountered: