forked from zephyrproject-rtos/gsoc-2022-arduino-core
-
-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Title pretty well describes it.
Optional: attach the sketch
Additional context
Running current stuff in the arduino branch, after the recent merge.
void setup() {
Serial.begin(115200);
while(!Serial && (millis() < 4000)) {}
Serial.println("Quick and dirty test");
pinMode(LED_BUILTIN, OUTPUT);
pinMode(LED_BUILTIN+1, OUTPUT);
pinMode(LED_BUILTIN+2, OUTPUT);
}
int loop_count = 0;
void loop() {
Serial.print("Loop count: ");
Serial.println(++loop_count);
Serial.flush();
digitalWrite(LED_BUILTIN, (loop_count & 1)? HIGH : LOW);
digitalWrite(LED_BUILTIN+1, (loop_count & 2)? HIGH : LOW);
digitalWrite(LED_BUILTIN+2, (loop_count & 4)? HIGH : LOW);
delay(250);
}
If you run the sketch above, without the Serial monitor connected, it will hang at the flush. It will startup when
you connect and it will stop again if you should close it.
If you comment out the Serial.flush(), it runs without this issue.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working