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.
Posible bug with Terminal::KeyPressed()
- johu
- Site Admin
- Posts: 5827
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 162 times
- Been thanked: 1045 times
- Contact:
Re: Posible bug with Terminal::KeyPressed()
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
I think I just checked for bytes in DMA buffer as well and returned true if >0
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9