Skip to content

Commit 0099416

Browse files
Fix typo in SerialEvent3 handling
In commit 0e97bcb (Put each HardwareSerial instance in its own .cpp file), the serial event handling was changed. This was probably a copy-paste typo. The effect of this bug was that SerialEvent3 would not run, unless SerialEvent2 was defined, but also that if SerialEvent2 is defined but SerialEvent3 is not, this could cause a reset (call to NULL pointer). This closes #1967, thanks to Peter Olson for finding the bug and fix.
1 parent b59826c commit 0099416

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: cores/arduino/HardwareSerial.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void serialEventRun(void)
7272
if (Serial2_available && serialEvent2 && Serial2_available()) serialEvent2();
7373
#endif
7474
#if defined(HAVE_HWSERIAL3)
75-
if (Serial3_available && serialEvent2 && Serial3_available()) serialEvent3();
75+
if (Serial3_available && serialEvent3 && Serial3_available()) serialEvent3();
7676
#endif
7777
}
7878

0 commit comments

Comments
 (0)