If you are wondering about RTOS, I think RTOS should be monitoring most interrupts as much as possible.
However, the questioner is curious about the timeout.?Timeouts will only occur in the original source of uBITX.
Suppose that you press the menu button once and wait for the next button in the while statement.
Let wsjt-x transmit the protocol that reads the frequency once every 500ms, and if there is no response, it displays an error and disconnects.
When the user presses the button to select the menu and wonders whether to move the band or change the CW tone, 500ms flows and wsjt-x displays an error and disconnects.
This is a problem that can be easily solved using an interrupt or an RTOS.?
For this reason I talked about the interrupt and the RTOS.?If you are wondering about RTOS, please feel free to ask.