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

core: do blocking read on serial port #177

Merged
merged 2 commits into from
Nov 27, 2017
Merged

core: do blocking read on serial port #177

merged 2 commits into from
Nov 27, 2017

Conversation

julianoes
Copy link
Collaborator

We should be able to read in a blocking way on the serial port since it
happens on a separate thread.

Fixes #176.

We should be able to read in a blocking way on the serial port since it
happens on a separate thread.
@shakthi-prashanth-m
Copy link
Contributor

shakthi-prashanth-m commented Nov 27, 2017

@julianoes is O_NONBLOCK is the culprit ? I agree we can do non-blocking read as it happens in a dedicated thread.. But I didn't understand yet about 100% CPU consumption.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 17.476% when pulling a5ba5e4 on fix-serial-cpu into 61bd810 on develop.

We want to wait for at least 1 byte, otherwise this is basically still a
nonblocking read and results in a busy loop.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 17.476% when pulling d0bf814 on fix-serial-cpu into 61bd810 on develop.

@julianoes
Copy link
Collaborator Author

Tested with a Pixhawk, will merge now because it's a bug.

@julianoes julianoes merged commit 4a4aa2b into develop Nov 27, 2017
@julianoes julianoes deleted the fix-serial-cpu branch November 27, 2017 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants