Skip to content
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

Feature: Add non-blocking serial break/unbreak functions #8671

Merged
merged 1 commit into from
Nov 19, 2018

Conversation

mray190
Copy link
Contributor

@mray190 mray190 commented Nov 7, 2018

Description

Current serial implementation has a send_break() command which sends a break command on the UART for a fixed amount of time. Fixed amount of time (in uS) is 18000000 / baud_rate. Additionally, the command is blocking.

This PR adds functions to the serial class to allow users to send a break in a non-blocking fashion, as well as for a user-specified amount of time.

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[x] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@mray190
Copy link
Contributor Author

mray190 commented Nov 7, 2018

Can ignore the 2 referenced PRs/commits - Pasted in this PR link for future reference and have nothing to do with this PR into mbed-os

@kjbracey
Copy link
Contributor

kjbracey commented Nov 8, 2018

Seems reasonable to me - obviously you need to know what you're doing, and not mix this with any output calls.

Would need more work to make it work with UARTSerial, but that could be an exercise for later. (Doesn't currently support send_break either.)

@0xc0170 0xc0170 changed the title Feature: Added non-blocking serial break/unbreak functions Feature: Add non-blocking serial break/unbreak functions Nov 8, 2018
Copy link
Contributor

@geky geky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

Copy link
Contributor

@kjbracey kjbracey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry, forgot to push my one comment to this. I think this is my only issue.

drivers/SerialBase.cpp Show resolved Hide resolved
Current serial implementation has a send_break() command which
sends a break command on the UART for a fixed amount of time.

Added functions to allow users to send a break in a non-blocking
fashion, as well as for a user-specified amount of time.
@mray190
Copy link
Contributor Author

mray190 commented Nov 13, 2018

@kjbracey-arm Added locks and unlocks surrounding each uart break call

@cmonr
Copy link
Contributor

cmonr commented Nov 16, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Nov 17, 2018

Build : SUCCESS

Build number : 3652
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8671/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Nov 17, 2018

@mbed-ci
Copy link

mbed-ci commented Nov 17, 2018

@0xc0170 0xc0170 merged commit 9aef9d3 into ARMmbed:master Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants