From 5bc33b94f84be593634f693bf2a8a79a66a37d99 Mon Sep 17 00:00:00 2001 From: Deepika Date: Tue, 10 Oct 2017 22:29:05 -0500 Subject: [PATCH] Access to serial device is allowed when DEVICE_SERIAL is defined --- platform/mbed_retarget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/mbed_retarget.cpp b/platform/mbed_retarget.cpp index 12fcb317a7..2be38c6fa1 100644 --- a/platform/mbed_retarget.cpp +++ b/platform/mbed_retarget.cpp @@ -351,7 +351,9 @@ extern "C" void PREFIX(_exit)(int return_code) { } extern "C" void _ttywrch(int ch) { +#if DEVICE_SERIAL serial_putc(&stdio_uart, ch); +#endif } #endif @@ -739,6 +741,7 @@ extern "C" int errno; // Dynamic memory allocation related syscall. #if defined(TARGET_NUVOTON) + // Overwrite _sbrk() to support two region model (heap and stack are two distinct regions). // __wrap__sbrk() is implemented in: // TARGET_NUMAKER_PFM_NUC472 targets/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/TOOLCHAIN_GCC_ARM/nuc472_retarget.c