Skip to content

fix uart_flush() returning early #2029

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
Nov 19, 2018
Merged

fix uart_flush() returning early #2029

merged 1 commit into from
Nov 19, 2018

Conversation

bertmelis
Copy link
Contributor

wait for UART FSM to become idle before uart_flush() returns:
current situation:
image

new situation:
image

tested with a simple sketch:

#include <Arduino.h>

void setup() {
  Serial.begin(112500);
  pinMode(26, OUTPUT);
}

void loop() {
  static uint32_t lastMillis = 0;
  if (millis() - lastMillis > 10000) {
    lastMillis = millis();
    digitalWrite(26, HIGH);
    Serial.write("Hello World!");
    Serial.flush();
    digitalWrite(26, LOW);
  }
}

Tested with Serial, Serial1 and Serial2.

wait for FSM to return idle
@bertmelis bertmelis changed the title fix flush returning early fix uart_flush() returning early Nov 7, 2018
@stickbreaker
Copy link
Contributor

@bertmelis That looks better!

@me-no-dev me-no-dev merged commit 44ca2ee into espressif:master Nov 19, 2018
@bertmelis bertmelis deleted the uart_flush branch November 20, 2018 08:56
bertmelis added a commit to bertmelis/esp32ModbusRTU that referenced this pull request Feb 18, 2019
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.

3 participants