aboutsummaryrefslogtreecommitdiff
path: root/cores
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2014-03-27 19:20:54 +0100
committerMatthijs Kooijman <matthijs@stdin.nl>2014-03-27 19:20:54 +0100
commit0099416ea46a0ff29b3d9b5612bcc2f87d0198d2 (patch)
tree392e9ac42866fce604dfd7512396fd782ea2bcc5 /cores
parentb59826cbd0712c46e5aa80fdfcd9ddcc07e4cbd2 (diff)
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.
Diffstat (limited to 'cores')
-rw-r--r--cores/arduino/HardwareSerial.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/cores/arduino/HardwareSerial.cpp b/cores/arduino/HardwareSerial.cpp
index a270ace..d91026a 100644
--- a/cores/arduino/HardwareSerial.cpp
+++ b/cores/arduino/HardwareSerial.cpp
@@ -72,7 +72,7 @@ void serialEventRun(void)
if (Serial2_available && serialEvent2 && Serial2_available()) serialEvent2();
#endif
#if defined(HAVE_HWSERIAL3)
- if (Serial3_available && serialEvent2 && Serial3_available()) serialEvent3();
+ if (Serial3_available && serialEvent3 && Serial3_available()) serialEvent3();
#endif
}