Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Eliminate write(c) from UARTDrivers #12643
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
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).