Fix a bug with backspace handling in modem
Fixes a bug where entering backspace while command buffer was already empty added backspace char to the buffer thus screwing it up.
This commit is contained in:
parent
99a47bc590
commit
9cb13f6158
1 changed files with 11 additions and 5 deletions
|
@ -718,11 +718,17 @@ void CSerialModem::Timer2(void) {
|
|||
rqueue->addb(txval);
|
||||
//LOG_MSG("Echo back to queue: %x",txval);
|
||||
}
|
||||
if (txval == 0xa) continue; //Real modem doesn't seem to skip this?
|
||||
else if (txval == 0x8 && (cmdpos > 0)) --cmdpos; // backspace
|
||||
else if (txval == 0xd) DoCommand(); // return
|
||||
else if (txval != '+') {
|
||||
if(cmdpos<99) {
|
||||
|
||||
if (txval == '\n')
|
||||
continue; // Real modem doesn't seem to skip this?
|
||||
|
||||
if (txval == '\b') {
|
||||
if (cmdpos > 0)
|
||||
cmdpos--;
|
||||
} else if (txval == '\r') {
|
||||
DoCommand();
|
||||
} else if (txval != '+') {
|
||||
if (cmdpos < 99) {
|
||||
cmdbuf[cmdpos] = txval;
|
||||
cmdpos++;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue