Posible bug with Terminal::KeyPressed()
Posted: Wed May 31, 2023 12:44 pm
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.
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.