Skip to content

Retarget - main - invoke serial init #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2016

Conversation

0xc0170
Copy link
Contributor

@0xc0170 0xc0170 commented Jan 13, 2016

Some toolchains might not call open() for stdio handles 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
}

An example above was not working for our gcc targets.

A note: YOTTA_CFG_MBED_OS_STDIO_DEFAULT_BAUD in this case is the one which is set, no matter what SerialBase ctor sets (if Serial() object (for USBTX,USBRX) is in a global scope, sets baudrate within ctor to different value than YOTTA_CFG_MBED_OS_STDIO_DEFAULT_BAUD), still get overwritten by YOTTA_CFG_MBED_OS_STDIO_DEFAULT_BAUD. Just stating this for a future reference

@bogdanm @pan-

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
}
```
@bogdanm
Copy link
Contributor

bogdanm commented Jan 13, 2016

Looks good. And you're right, static initializers can mess with this, but I think this was a problem in the previous code too, so I'll not attempt to fix this here. +1.

@pan-
Copy link
Member

pan- commented Jan 13, 2016

+1

@0xc0170
Copy link
Contributor Author

0xc0170 commented Jan 13, 2016

I tried to restart jenkins, it timeouts for our frdm-k64f anyway , should not be the case. I'll report this to jenkins team.

0xc0170 added a commit that referenced this pull request Jan 14, 2016
Retarget - main - invoke serial init
@0xc0170 0xc0170 merged commit ef71836 into ARMmbed:master Jan 14, 2016
@marcuschangarm
Copy link
Contributor

what have you done!?! 😱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants