Skip to content

Commit 173ed6d

Browse files
committed
Don't flush the serial buffers if inCommandMode
1 parent 142e2a4 commit 173ed6d

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
@@ -931,10 +931,8 @@ void resetSerial()
931931

932932
//Empty the buffers
933933
rxHead = rxTail;
934-
radioTxHead = radioTxTail;
935934
txHead = txTail;
936935
commandRXHead = commandRXTail;
937936
commandTXHead = commandTXTail;
938-
endOfTxData = &outgoingPacket[headerBytes];
939937
commandLength = 0;
940938
}

Firmware/LoRaSerial/States.ino

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

28892889
//Flush the buffers
2890-
resetSerial();
2890+
if (!inCommandMode)
2891+
resetSerial();
2892+
radioTxHead = radioTxTail;
2893+
endOfTxData = &outgoingPacket[headerBytes];
28912894

28922895
//Reset the radio and the link
28932896
triggerEvent(TRIGGER_RADIO_RESET);
@@ -3052,7 +3055,11 @@ void vcBreakLink(int8_t vcIndex)
30523055
//Flush the buffers
30533056
outputSerialData(true);
30543057
if (vcIndex == myVc)
3058+
{
30553059
resetSerial();
3060+
radioTxHead = radioTxTail;
3061+
endOfTxData = &outgoingPacket[headerBytes];
3062+
}
30563063
}
30573064

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

0 commit comments

Comments
 (0)