arduino / ArduinoCore-megaavr

Arduino Core for the ATMEGA4809 CPU
103 stars 62 forks source link

Really bad code in Serial transmit interrupt driver #43

Closed egilkv closed 4 years ago

egilkv commented 4 years ago

There is a really bad while loop in the transmit interrupt driver that causes the CPU to spend most of its time looping with interrupts disabled in the interrupt driver.

I must say I was very surprised to find this, makes one wonder what other things went passed code review and testing?

Anyway, the fix is here: https://github.com/arduino/ArduinoCore-megaavr/pull/42

I have attached a simple test program that shows just how serious this is (try it with and without the patch): Test_serial_bug.txt Another way to test is to transmit a lot on one or more serial channels and receive at the same time. You will loose a lot of characters.

facchinm commented 4 years ago

Fixed by merging #42