File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ void serialBufferOutput(uint8_t * data, uint16_t dataLength)
3535{
3636 int length;
3737
38+ // Make sure there is enough room in the buffer
39+ if ((sizeof (serialTransmitBuffer) - availableTXBytes ()) < (dataLength + 32 ))
40+ outputSerialData (true );
41+
3842 length = 0 ;
3943 if ((txHead + dataLength) > sizeof (serialTransmitBuffer))
4044 {
@@ -55,6 +59,10 @@ void serialOutputByte(uint8_t data)
5559{
5660 if (printerEndpoint == PRINT_TO_SERIAL)
5761 {
62+ // Make sure there is enough room in the buffer
63+ if ((sizeof (serialTransmitBuffer) - availableTXBytes ()) < 32 )
64+ outputSerialData (true );
65+
5866 // Add this byte to the serial output buffer
5967 serialTransmitBuffer[txHead++] = data;
6068 txHead %= sizeof (serialTransmitBuffer);
You can’t perform that action at this time.
0 commit comments