Dial Tone
You inherited a UART command processor that should handle incomplete transmissions gracefully. When bytes stop arriving mid-command (no newline received after the last byte), the firmware should discard the partial buffer so the next command parses cleanly.
The timeout is implemented as a poll-loop countdown: each loop iteration with no new byte should decrement a counter. When it reaches zero, the partial receive is discarded and the receiver resets for the next command.
The protocol is simple: PING\n -> respond "PONG\n" ECHO:xxx\n -> respond "xxx\n" (echo back everything after the colon) (unknown) -> respond "ERR\n"
A partial command like "PIN" (no newline) should be silently discarded after timeout, so that the next real command parses from a clean buffer.
The starter code compiles cleanly and handles normal commands correctly, but incomplete commands corrupt subsequent messages. Find and fix all the bugs.