Skip to content

Commit 8ef714f

Browse files
committed
more idiomatic code.
1 parent 3896e04 commit 8ef714f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/onreceive/onreceive.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,15 @@ void setup() {
4444
}
4545

4646
void loop() {
47+
#ifdef ESP8266
4748
bool isRxPending = rxPending.load();
48-
auto avail = testSerial.available();
4949
if (isRxPending) {
5050
rxPending.store(false);
5151
}
52+
#else
53+
bool isRxPending = m_isrOverflow.exchange(false);
54+
#endif
55+
auto avail = testSerial.available();
5256
if (isRxPending && !avail) {
5357
// event fired on start bit, wait until first stop bit of longest frame
5458
delayMicroseconds(1 + MAX_FRAMEBITS * 1000000 / BAUD_RATE);

0 commit comments

Comments
 (0)