1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-03 14:24:15 +01:00
Arduino/hardware/arduino/avr/libraries
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
..
EEPROM missing paragraph field in library.properties 2014-07-18 20:08:01 +02:00
SoftwareSerial Disable the RX PCINT inside SoftwareSerial::recv 2015-01-26 17:03:25 +01:00
SPI Fix atomicity issues in SPI::beginTransaction and SPI::endTransaction (Andrew Kroll) 2014-11-25 15:56:11 +01:00
Wire missing paragraph field in library.properties 2014-07-18 20:08:01 +02:00