-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
Magic is built in to initialise and bind stdio to a target-specified serial port. This is lovely.
But people still write code like this:
Serial output(USBTX, USBRX);
int main()
{
output.baud(115200);
output.printf("\r\n\r\nConnecting...\r\n");
They start with the Serial object because they need to set the baud rate. If they did use stdio, best they could do would be this slightly iffy mixed version:
Serial output(USBTX, USBRX);
int main()
{
output.baud(115200);
printf("\n\nConnecting...\n");
(assuming #1876 is merged). They can't drop the board pin knowledge.
Stdio serial baud rate should be configurable ("mbed.stdio-serial-baud") so the example app can just be:
int main()
{
printf("\n\nConnecting...\n");
with baud set in the json. App is now board portable.
Metadata
Metadata
Assignees
Labels
No labels