Skip to content

Commit 50c30d3

Browse files
authored
Merge pull request #2741 from pan-/conf_flush_at_exit
Add configuration for IO flushing during exit.
2 parents 5ef7202 + 9803b62 commit 50c30d3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

hal/common/retarget.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,11 @@ extern "C" void exit(int return_code) {
609609
#endif
610610

611611
#if DEVICE_STDIO_MESSAGES
612+
#if MBED_CONF_CORE_STDIO_FLUSH_AT_EXIT
612613
fflush(stdout);
613614
fflush(stderr);
614615
#endif
616+
#endif
615617

616618
#if DEVICE_SEMIHOST
617619
if (mbed_interface_connected()) {

mbed_lib.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
"stdio-baud-rate": {
1010
"help": "Baud rate for stdio",
1111
"value": 9600
12+
},
13+
14+
"stdio-flush-at-exit": {
15+
"help": "Enable or disable the flush of standard I/O's at exit.",
16+
"value": true
1217
}
1318
}
1419
}

0 commit comments

Comments
 (0)