Skip to content

Commit 7a27c87

Browse files
committed
Only start one command at a time
1 parent 7ed4b78 commit 7a27c87

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

Firmware/LoRaSerial/Serial.ino

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -414,17 +414,22 @@ void processSerialInput()
414414
//Process serial into either rx buffer or command buffer
415415
if (inCommandMode == true)
416416
{
417-
if (incoming == '\r' && commandLength > 0)
417+
//Check for end of command
418+
if (incoming == '\r')
418419
{
419-
printerEndpoint = PRINT_TO_SERIAL;
420-
systemPrintln();
421-
if (settings.debugSerial)
420+
//Ignore end of command if no command in the buffer
421+
if (commandLength > 0)
422422
{
423-
systemPrint("processSerialInput moved ");
424-
systemPrint(commandLength);
425-
systemPrintln(" from serialReceiveBuffer into commandBuffer");
423+
systemPrintln();
424+
if (settings.debugSerial)
425+
{
426+
systemPrint("processSerialInput moved ");
427+
systemPrint(commandLength);
428+
systemPrintln(" from serialReceiveBuffer into commandBuffer");
429+
}
430+
checkCommand(); //Process command buffer
431+
break;
426432
}
427-
checkCommand(); //Process command buffer
428433
}
429434
else if (incoming == '\n')
430435
; //Do nothing

0 commit comments

Comments
 (0)