1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-03 14:24:15 +01:00
Arduino/hardware/arduino/avr/libraries/SoftwareSerial
Matthijs Kooijman 08fa593916 Disable the RX PCINT inside SoftwareSerial::recv
Before, the interrupt would remain enabled during reception, which would
re-set the PCINT flag because of the level changes inside the received
byte. Because interrupts are globally disabled, this would not
immediately trigger an interrupt, but the flag would be remembered to
trigger another PCINT interrupt immediately after the first one is
processed.

Typically this was not a problem, because the second interrupt would see
the stop bit, or an idle line, and decide that the interrupt triggered
for someone else. However, at high baud rates, this could cause the
next interrupt for the real start bit to be delayed so much that the
byte got corrupted.

By clearing the interrupt mask bit for just the RX pin (as opposed to
the PCINT mask bit for the entire port), any PCINT events on other bits
can still set the PCINT flag and be processed as normal. In this case,
it's likely that there will be corruption, but that's inevitable when
(other) interrupts happen during SoftwareSerial reception.
2015-01-26 17:03:25 +01:00
..
examples Revert "SoftwareSerial library to the new format" 2013-11-15 12:54:59 +01:00
keywords.txt Revert "SoftwareSerial library to the new format" 2013-11-15 12:54:59 +01:00
library.properties missing paragraph field in library.properties 2014-07-18 20:08:01 +02:00
SoftwareSerial.cpp Disable the RX PCINT inside SoftwareSerial::recv 2015-01-26 17:03:25 +01:00
SoftwareSerial.h Disable the RX PCINT inside SoftwareSerial::recv 2015-01-26 17:03:25 +01:00