Closed allexoll closed 3 years ago
isr.tc().bit_is_set()
As far as I know this does not perform the status register read, but reads the isr
variable that was obtained on the first line.
you can have a race condition if the TC flag is set between the read and the clear flag. that way, you will clear the flag, but the tc flag won't be detected. i think the correct implementation should be test flag, and clear flag only if the flag is set.
Got it, I must agree
Fixed in #188.
I believe the uart flush has the operation in the wrong order. please correct me if i'm wrong.
i believe the write to tccf should be done after checking for TC bit. the way it is done now means that we clear the TC flag before checking it, meaning that the condition will always return
WouldBlock
.I'm happy to do a PR if i'm correct.