Skip to content

Commit

Permalink
further fix for missing CONSOLE_TX/RX in porting guide
Browse files Browse the repository at this point in the history
see #1457

earlier change #1454 did 
not address both instances (FileHandle.md as well as 
pin_names_porting.md)
  • Loading branch information
ChrisGooch-Arm committed Jul 19, 2021
1 parent ae468ed commit 1cf4866
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/api/platform/FileHandle.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ namespace mbed

Then any program using `printf` on that target sends its output over the SWO, rather than serial.

Because targets can redirect the console in this way, portable applications should not use constructs such as `Serial(USBTX, USBRX)`, assuming that this will access the console. Instead they should use `stdin`/`stdout`/`stderr` or `STDIN_FILENO`/`STDOUT_FILENO`/`STDERR_FILENO`.
Because targets can redirect the console in this way, portable applications should not use constructs such as `Serial(CONSOLE_TX, CONSOLE_RX)`, assuming that this will access the console. Instead they should use `stdin`/`stdout`/`stderr` or `STDIN_FILENO`/`STDOUT_FILENO`/`STDERR_FILENO`.

```
// Don't do:
Serial serial(USBTX, USBRX);
Serial serial(CONSOLE_TX, CONSOLE_RX);
serial.printf("Hello!\r\n");
// Do do:
Expand Down

0 comments on commit 1cf4866

Please sign in to comment.