I have my UART running with interrupts, and I use it for a development/service-menu. In that menu I can set some pins, run a sequence, read sensors, change settings in the eeprom (using a EEMEM struct), and so on.
The terminal programs on my computer use CR, or LF, or CRLF.
Waiting until a line is entered and returning it as a string without CR or LF is no problem, but the next line could contain the 'LF' which was still in the buffer if the terminal sends CRLF.
I also want to request the number of characters in my buffer, and this should be the actual number of characters.
And I want to be able to enter an empty line.
Is there a common solution for this?