Skip to content

Commit 8ad8327

Browse files
committed
restructure - Moved stdio-config into platform
1 parent 15904b7 commit 8ad8327

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

mbed_lib.json renamed to platform/mbed_lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "core",
2+
"name": "platform",
33
"config": {
44
"stdio-convert-newlines": {
55
"help": "Enable conversion to standard newlines on stdin/stdout",

platform/retarget.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ FileHandle::~FileHandle() {
9898
#if DEVICE_SERIAL
9999
extern int stdio_uart_inited;
100100
extern serial_t stdio_uart;
101-
#if MBED_CONF_CORE_STDIO_CONVERT_NEWLINES
101+
#if MBED_CONF_PLATFORM_STDIO_CONVERT_NEWLINES
102102
static char stdio_in_prev;
103103
static char stdio_out_prev;
104104
#endif
@@ -108,8 +108,8 @@ static void init_serial() {
108108
#if DEVICE_SERIAL
109109
if (stdio_uart_inited) return;
110110
serial_init(&stdio_uart, STDIO_UART_TX, STDIO_UART_RX);
111-
#if MBED_CONF_CORE_STDIO_BAUD_RATE
112-
serial_baud(&stdio_uart, MBED_CONF_CORE_STDIO_BAUD_RATE);
111+
#if MBED_CONF_PLATFORM_STDIO_BAUD_RATE
112+
serial_baud(&stdio_uart, MBED_CONF_PLATFORM_STDIO_BAUD_RATE);
113113
#endif
114114
#endif
115115
}
@@ -243,7 +243,7 @@ extern "C" int PREFIX(_write)(FILEHANDLE fh, const unsigned char *buffer, unsign
243243
if (fh < 3) {
244244
#if DEVICE_SERIAL
245245
if (!stdio_uart_inited) init_serial();
246-
#if MBED_CONF_CORE_STDIO_CONVERT_NEWLINES
246+
#if MBED_CONF_PLATFORM_STDIO_CONVERT_NEWLINES
247247
for (unsigned int i = 0; i < length; i++) {
248248
if (buffer[i] == '\n' && stdio_out_prev != '\r') {
249249
serial_putc(&stdio_uart, '\r');
@@ -281,7 +281,7 @@ extern "C" int PREFIX(_read)(FILEHANDLE fh, unsigned char *buffer, unsigned int
281281
// only read a character at a time from stdin
282282
#if DEVICE_SERIAL
283283
if (!stdio_uart_inited) init_serial();
284-
#if MBED_CONF_CORE_STDIO_CONVERT_NEWLINES
284+
#if MBED_CONF_PLATFORM_STDIO_CONVERT_NEWLINES
285285
while (true) {
286286
char c = serial_getc(&stdio_uart);
287287
if ((c == '\r' && stdio_in_prev != '\n') ||
@@ -609,7 +609,7 @@ extern "C" void exit(int return_code) {
609609
#endif
610610

611611
#if DEVICE_STDIO_MESSAGES
612-
#if MBED_CONF_CORE_STDIO_FLUSH_AT_EXIT
612+
#if MBED_CONF_PLATFORM_STDIO_FLUSH_AT_EXIT
613613
fflush(stdout);
614614
fflush(stderr);
615615
#endif

0 commit comments

Comments
 (0)