Skip to content

Commit e0c533e

Browse files
authored
Merge pull request #519 from LeeLeahy2/no-flush-serial-buffers-in-cmd-mode
Don't flush the serial buffers if inCommandMode
2 parents 27b2e1d + 173ed6d commit e0c533e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Firmware/LoRaSerial/Serial.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,10 +938,8 @@ void resetSerial()
938938

939939
//Empty the buffers
940940
rxHead = rxTail;
941-
radioTxHead = radioTxTail;
942941
txHead = txTail;
943942
commandRXHead = commandRXTail;
944943
commandTXHead = commandTXTail;
945-
endOfTxData = &outgoingPacket[headerBytes];
946944
commandLength = 0;
947945
}

Firmware/LoRaSerial/States.ino

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2912,7 +2912,10 @@ void breakLink()
29122912
}
29132913

29142914
//Flush the buffers
2915-
resetSerial();
2915+
if (!inCommandMode)
2916+
resetSerial();
2917+
radioTxHead = radioTxTail;
2918+
endOfTxData = &outgoingPacket[headerBytes];
29162919

29172920
//Reset the radio and the link
29182921
triggerEvent(TRIGGER_RADIO_RESET);
@@ -3077,7 +3080,11 @@ void vcBreakLink(int8_t vcIndex)
30773080
//Flush the buffers
30783081
outputSerialData(true);
30793082
if (vcIndex == myVc)
3083+
{
30803084
resetSerial();
3085+
radioTxHead = radioTxTail;
3086+
endOfTxData = &outgoingPacket[headerBytes];
3087+
}
30813088
}
30823089

30833090
//Place VC in LINK-UP state since it is receiving HEARTBEATs from the remote radio

0 commit comments

Comments
 (0)