Makes flush of IOs at exit configurable.

This change allows program which doesn't use the IO subsystem to
completelly get rid of it in the binary generated.

IO's are still flushed by default but it can be overriden in
configuration.
pull/2741/head
Vincent Coubard 2016-09-19 10:33:48 +01:00
parent 7669d7f8f5
commit 9803b62b4d
2 changed files with 7 additions and 0 deletions

View File

@ -609,9 +609,11 @@ extern "C" void exit(int return_code) {
#endif
#if DEVICE_STDIO_MESSAGES
#if MBED_CONF_CORE_STDIO_FLUSH_AT_EXIT
fflush(stdout);
fflush(stderr);
#endif
#endif
#if DEVICE_SEMIHOST
if (mbed_interface_connected()) {

View File

@ -9,6 +9,11 @@
"stdio-baud-rate": {
"help": "Baud rate for stdio",
"value": 9600
},
"stdio-flush-at-exit": {
"help": "Enable or disable the flush of standard I/O's at exit.",
"value": true
}
}
}