-
Notifications
You must be signed in to change notification settings - Fork 28
Check function for serial error. #70
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
base: master
Are you sure you want to change the base?
Conversation
How are you using this function? The async shall return an error during the transmission. However, the one byte transfer using attach() in mbed-drivers, does not accept any arguments. I assume this is the function you use to get serial errors. It might be better to have defined error values, as oppose to boolean. |
Yes, the use case I created the function for is detecting corrupted packets over SLIP; I assume corrupted packets on RX overrun, parity and framing error. The 1st thing in in my interrupt routine (attach()'d) I check (using this function) if error occurred, and if so I discard all the data and start waiting for sync byte on the SLIP protocol I run over the serial line. |
Perhaps it would make sens to return a bit field as a return value rather than boolean, and create defines the bits. |
Updated according to the comments. |
@0xc0170 Any comments to the change? |
* (in the mentioned order starting from the least significant bit). | ||
* | ||
* @param obj The serial object | ||
* @return Non-zero value if any of the errors have occurred, 0 otherwise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return values shall be described as @RetVal - each of the possible return values. You can rebase the current branch here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the documentation. Added a few @RetVal tags as an example; didn't want to enumerate the whole list of values. A developer should get the idea...
@jpellikk-arm Probably the last request - please add to the documentation that it should clear the flag once it reads it. I noticed it's missing here, and it's done in its ksdk implementation. Sorry for the delay for this merge, but we are close to the release. To merge this, we should implement this for nrf51 as well, however this would break any other targets. We need to address this, will get back to you. |
c07ed62
to
f921e3b
Compare
@0xc0170 Could you please merge this in? I don't have the rights to do that. |
@0xc0170 The API change corresponding to the PR below:
ARMmbed/mbed-hal-ksdk-mcu#57