Skip to content

Commit f79bfdd

Browse files
committed
Make stdin/stdout/stderr be FileHandles
Rework so that everything is a FileHandle, including stdin/stdout/stderr. Provide legacy functionality of calling serial_getc and serial_putc as an internal "DirectSerial" FileHandle. Add a JSON option to use UARTSerial instead. Add hooks for target and application to provide custom FileHandles. Allow for CRLF conversion to work on any FileHandle that isatty(), as stdin/stdout or any other FILE. Optimise the conversion so it doesn't force all write calls to be 1 byte. Limit the conversion to the stdio layer, so that read() and write() work the same as the FileHandle methods - this seems less confusing.
1 parent 96c709f commit f79bfdd

File tree

3 files changed

+351
-131
lines changed

3 files changed

+351
-131
lines changed

platform/mbed_lib.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22
"name": "platform",
33
"config": {
44
"stdio-convert-newlines": {
5-
"help": "Enable conversion to standard newlines on stdin/stdout",
5+
"help": "Enable conversion to standard newlines on stdin/stdout/stderr",
6+
"value": false
7+
},
8+
9+
"stdio-convert-tty-newlines": {
10+
"help": "Enable conversion to standard newlines on any tty FILE stream",
11+
"value": false
12+
},
13+
14+
"stdio-buffered-serial": {
15+
"help": "Use UARTSerial driver to obtain buffered serial I/O on stdin/stdout/stderr. If false, unbuffered serial_getc and serial_putc are used directly.",
616
"value": false
717
},
818

0 commit comments

Comments
 (0)