-
Notifications
You must be signed in to change notification settings - Fork 16.8k
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
Eliminate write(c) from UARTDrivers #12643
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
peterbarker
force-pushed
the
pr/eliminate-char-write
branch
2 times, most recently
from
October 25, 2019 13:42
589c534
to
aa9ebc4
Compare
peterbarker
force-pushed
the
pr/eliminate-char-write
branch
from
October 25, 2019 23:29
aa9ebc4
to
1a4f6ad
Compare
On a quick look this seems good to me |
WickedShell
reviewed
Oct 27, 2019
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.
Not even remotely a real review, just posting the comment.
peterbarker
force-pushed
the
pr/eliminate-char-write
branch
from
October 28, 2019 02:23
831a550
to
1a4f6ad
Compare
Vast amounts of duplicated logic gaining us very little, and at least one bug in SITL
peterbarker
force-pushed
the
pr/eliminate-char-write
branch
from
November 8, 2019 21:05
1a4f6ad
to
ecb83c7
Compare
I've tested this on a Pixhawk and things seem to work as expected. |
As discussed on the dev call we will leave this one for @tridge to review before merging. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is cleanup I've wanted to do for a while.
This seems to be a leftover from our APM days; who would want to write char-at-a-time if they could avoid it?
Well, that was partly rhetorical; snprintf does, so this may make snprintf marginally slower. I've put a patch in which should spit out the %s-replaced strings in one shot, 'though. There are other optimisations available in there - e.g. remembering the start of a chunk of bytes to send through from the format string with a
write(...)
call; basically anything which loops aroundwrite(c)
This also fixes a bug with the existing Linux UARTDriver where you can't actually send out a bunch of bytes to the console. I will be creating a second, simpler PR to fix that in case this one has problems going in (and to highlight where the problem is).