Skip to content

Commit 54609f6

Browse files
committed
Added default value for MBED_CONF_CORE_STDIO_CONVERT_NEWLINES
1 parent 1480c23 commit 54609f6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

hal/common/retarget.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ FileHandle::~FileHandle() {
8888
#if DEVICE_SERIAL
8989
extern int stdio_uart_inited;
9090
extern serial_t stdio_uart;
91-
#ifdef MBED_CONF_CORE_STDIO_CONVERT_NEWLINES
91+
#if MBED_CONF_CORE_STDIO_CONVERT_NEWLINES
9292
static char stdio_in_prev;
9393
static char stdio_out_prev;
9494
#endif
@@ -230,7 +230,7 @@ extern "C" int PREFIX(_write)(FILEHANDLE fh, const unsigned char *buffer, unsign
230230
if (fh < 3) {
231231
#if DEVICE_SERIAL
232232
if (!stdio_uart_inited) init_serial();
233-
#ifdef MBED_CONF_CORE_STDIO_CONVERT_NEWLINES
233+
#if MBED_CONF_CORE_STDIO_CONVERT_NEWLINES
234234
for (unsigned int i = 0; i < length; i++) {
235235
if (buffer[i] == '\n' && stdio_out_prev != '\r') {
236236
serial_putc(&stdio_uart, '\r');
@@ -268,7 +268,7 @@ extern "C" int PREFIX(_read)(FILEHANDLE fh, unsigned char *buffer, unsigned int
268268
// only read a character at a time from stdin
269269
#if DEVICE_SERIAL
270270
if (!stdio_uart_inited) init_serial();
271-
#ifdef MBED_CONF_CORE_STDIO_CONVERT_NEWLINES
271+
#if MBED_CONF_CORE_STDIO_CONVERT_NEWLINES
272272
while (true) {
273273
char c = serial_getc(&stdio_uart);
274274
if ((c == '\r' && stdio_in_prev != '\n') ||

mbed_lib.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "core",
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",
6+
"value": false
67
}
78
}
89
}

0 commit comments

Comments
 (0)