Page 1 of 1

Posible bug with Terminal::KeyPressed()

Posted: Wed May 31, 2023 12:44 pm
by Pete9008
Been trying to use Terminal::KeyPressed() to terminate logging but couldn't get it to work (only worked occasionally). It turns out that the UART Rx DMA was still active in the background and grabbing the characters out the UART buffer and clearing the flag before KeyPressed saw it. Might be an issue in other places that the function is used too??

I've added a public Terminal::GetRxNumBytesAvail() function that returns the number of bytes in the DMA buffer and look for a change in value instead.

Re: Posible bug with Terminal::KeyPressed()

Posted: Sun Jun 11, 2023 5:27 pm
by johu
Yes, I noticed this as well and fixed it but never published it :(

I think I just checked for bytes in DMA buffer as well and returned true if >0