1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-30 11:24:12 +01:00
Arduino/hardware/arduino/avr
Matthijs Kooijman ccd8880a37 Fix lockup when writing to HardwareSerial with interrupts disabled
When interrupts are disabled, writing to HardwareSerial could cause a
lockup. When the tx buffer is full, a busy-wait loop is used to wait for
the interrupt handler to free up a byte in the buffer. However, when
interrupts are disabled, this will of course never happen and the
Arduino will lock up. This often caused lockups when doing (big) debug
printing from an interrupt handler.

Additionally, calling flush() with interrupts disabled while
transmission was in progress would also cause a lockup.

When interrupts are disabled, the code now actively checks the UDRE
(UART Data Register Empty) and calls the interrupt handler to free up
room if the bit is set.

This can lead to delays in interrupt handlers when the serial buffer is
full, but a delay is of course always preferred to a lockup.

Closes: #672
References: #1147
2014-01-22 09:38:16 +01:00
..
bootloaders merge 2013-10-14 12:42:42 +02:00
cores/arduino Fix lockup when writing to HardwareSerial with interrupts disabled 2014-01-22 09:38:16 +01:00
firmwares Merged 1.0.5 2013-04-03 13:51:04 +02:00
libraries Revert "SPI library to new format" 2013-11-21 15:05:36 +01:00
variants Merge branch 'pins-define' into ide-1.5.x 2013-12-13 15:09:40 +01:00
boards.txt In boards.txt, rename atmega328diecimila to diecimila 2013-12-08 18:16:31 +01:00
platform.txt Fixed "runtime.hardware.path" and "runtime.platform.path" values 2014-01-05 12:42:27 +01:00
programmers.txt Set correct speed of Arduino ISP programmer 2013-04-06 01:59:25 +02:00