We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
HardwareSerial::flush()
Stream*->flush()
Please, before reporting any issue
Any questions/feedback/suggestions should be discussed on the stm32duino forum:
⚠ When reporting any issue, please try to provide all relevant information to help on its resolution.
Describe the bug HardwareSerial::flush() returns early if called via Stream* interface
To Reproduce
const int PIN_EN = PA1; const int PIN_TX = PA2; const int PIN_RX = PA3; HardwareSerial Serial1(PIN_RX, PIN_TX); Stream* streamTest = &Serial1; void setup() { Serial1.begin(115200); pinMode(PIN_EN, OUTPUT); } void loop() { // Calling directly Serial1.print("aaaaaa"); digitalWrite(PIN_EN, HIGH); Serial1.flush(); digitalWrite(PIN_EN, LOW); // Goes low only after data has been fully transmitted delay(1); // Calling via generic stream interface streamTest->print("bbbbbb"); digitalWrite(PIN_EN, HIGH); streamTest->flush(); digitalWrite(PIN_EN, LOW); // Goes low immediately delay(1); }
Expected behavior In the above code, streamTest->flush() should return only once the data has been fully flushed.
streamTest->flush()
Screenshots
Desktop (please complete the following information):
Board (please complete the following information):
Additional context This appears to be a side effect of #2124, as reverting that commit results in the issue going away.
It seems as though the optional parameter is preventing HardwareSerial::flush(uint32_t timeout = 0) from properly overloading Stream::flush(void).
HardwareSerial::flush(uint32_t timeout = 0)
Stream::flush(void)
Therefore, another method of resolving is by modifying HardwareSerial.h from
virtual void flush(uint32_t timeout = 0);
to
virtual void flush() { flush(0); } virtual void flush(uint32_t timeout);
The text was updated successfully, but these errors were encountered:
Need to search better. #2254
Sorry, something went wrong.
Hi @mlaga97 No worry, fix will be available within next release in the coming weeks.
No branches or pull requests
Please, before reporting any issue
https://github.com/stm32duino/Arduino_Core_STM32/releases/latest
Any questions/feedback/suggestions should be discussed on the stm32duino forum:
⚠ When reporting any issue, please try to provide all relevant information to help on its resolution.
Describe the bug
HardwareSerial::flush()
returns early if called via Stream* interfaceTo Reproduce
Expected behavior
In the above code,
streamTest->flush()
should return only once the data has been fully flushed.Screenshots
Desktop (please complete the following information):
Board (please complete the following information):
Additional context
This appears to be a side effect of #2124, as reverting that commit results in the issue going away.
It seems as though the optional parameter is preventing
HardwareSerial::flush(uint32_t timeout = 0)
from properly overloadingStream::flush(void)
.Therefore, another method of resolving is by modifying HardwareSerial.h from
to
The text was updated successfully, but these errors were encountered: