Skip to content

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