From 0f7183fe4b393f5985009b0ffe382c0de46943a6 Mon Sep 17 00:00:00 2001 From: Martin Kojtal Date: Wed, 13 Jan 2016 13:23:53 +0000 Subject: [PATCH] Retarget - main - invoke serial init Some toolchains might not call open() for stdio handle prior main, which breaks usage: ``` void app_start(int, char**) { Serial pc(tx, rx); pc.baud(115200); printf("sss \n"); //open stdio might happen here } ``` --- source/retarget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/retarget.cpp b/source/retarget.cpp index 5f719316..c62efdbc 100644 --- a/source/retarget.cpp +++ b/source/retarget.cpp @@ -493,6 +493,8 @@ extern "C" void __iar_argc_argv() { // the user should set up their application in app_start extern void app_start(int, char**); extern "C" int main(void) { + // init serial if it has not been invoked prior main + init_serial(); minar::Scheduler::postCallback( mbed::util::FunctionPointer2(&app_start).bind(0, NULL) );