Skip to content

Commit efea142

Browse files
committed
board - fix vfprintf - use putc() instead of serial stdio
we do not need to check if stdio is initialized, retarget does that, thus invoke putc().
1 parent 526e731 commit efea142

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

hal/common/mbed_board.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
#include "critical.h"
2222
#include "serial_api.h"
2323

24-
#if DEVICE_SERIAL
25-
extern int stdio_uart_inited;
26-
extern serial_t stdio_uart;
27-
#endif
28-
2924
WEAK void mbed_die(void) {
3025
#if !defined (NRF51_H) && !defined(TARGET_EFM32)
3126
core_util_critical_section_enter();
@@ -79,11 +74,8 @@ void mbed_error_vfprintf(const char * format, va_list arg) {
7974
char buffer[128];
8075
int size = vsprintf(buffer, format, arg);
8176
if (size > 0) {
82-
if (!stdio_uart_inited) {
83-
serial_init(&stdio_uart, STDIO_UART_TX, STDIO_UART_RX);
84-
}
8577
for (int i = 0; i < size; i++) {
86-
serial_putc(&stdio_uart, buffer[i]);
78+
putc(buffer[i], stdout);
8779
}
8880
}
8981
core_util_critical_section_exit();

0 commit comments

Comments
 (0)