Skip to content

Commit

Permalink
Merge branch '3.5-dev' of https://github.com/Duet3D/RepRapFirmware in…
Browse files Browse the repository at this point in the history
…to 3.5-dev
  • Loading branch information
dc42 committed Dec 14, 2023
2 parents db9bd0b + 49834aa commit 55ae311
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GCodes/GCodeInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ bool BufferedStreamGCodeInput::FillBuffer(GCodeBuffer *gb) noexcept
const size_t spaceLeft = BufferSpaceLeft();
if (spaceLeft >= GCodeInputUSBReadThreshold)
{
const size_t maxToTransfer = (readingPointer > writingPointer) ? spaceLeft : GCodeInputBufferSize - writingPointer;
const size_t maxToTransfer = (readingPointer > writingPointer || writingPointer == 0) ? spaceLeft : GCodeInputBufferSize - writingPointer;
writingPointer = (writingPointer + device.readBytes(buffer + writingPointer, maxToTransfer)) % GCodeInputBufferSize;
}
return StandardGCodeInput::FillBuffer(gb);
Expand Down

0 comments on commit 55ae311

Please sign in to comment.