Convert command queue from static to dynamic #3010
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Convert command queue from static to dynamic
Requirements
Any TFT touchscreen
Description & Benefits
The commands received by the TFT are stored in an internal command queue for further processing. If the command queue is full and a new command arrives then the dreaded "Busy processing" message pops up. The current command queue implementation is a static buffer of 20 command of 100 bytes each (2000 bytes command buffer). This is kind of wasteful as most gcode commands are only a few bytes long and movement commands are typically below 40 bytes long.
This PR changes this by making the command buffer dynamic, a command is stored in the dynamic buffer in a FIFO way and uses only the space in the buffer that is actually needed to store the command (+ terminating 0). This allows for roughly 3 times more commands in the same buffer size, and the "busy processing" message becomes a thing of the past.
Related Issues