Skip to content
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

C nested code seems to "freeze" await statements #1

Open
AnnyCaroline opened this issue Sep 2, 2019 · 1 comment
Open

C nested code seems to "freeze" await statements #1

AnnyCaroline opened this issue Sep 2, 2019 · 1 comment

Comments

@AnnyCaroline
Copy link
Member

This code only prints "1"

#include "wclock.ceu"

_Serial.begin(9600);
_Serial.println("1\n");
await 1s;
_Serial.println("2\n");
await FOREVER;

Without the C nested code, it prints "1" and "2"

#include "wclock.ceu"

//{int x = 1;}

_Serial.begin(9600);
_Serial.println("1\n");
await 1s;
_Serial.println("2\n");
await FOREVER;

Note: I'm using CEU_DEFS = -DCEU_PM_MIN at Makefile.conf

@AnnyCaroline
Copy link
Member Author

Using the USART driver (instead of Arduino Serial), the error still occurs:

#include "wclock.ceu"
#include "usart.ceu"
#include "string.ceu"

{int x = 1;}

spawn USART_Init(9600);

var[3] byte str1;
call String_Append_STR(&str1, "1");
await USART_Tx(&str1); //freezes here

await 1s;

var[3] byte str2;
call String_Append_STR(&str2, "2");//freezes here
await USART_Tx(&str2);

await FOREVER;

Removing the C nested code seems to solve the problem.

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

No branches or pull requests

1 participant