vicious1
(Ryan)
February 10, 2022, 10:19pm
41
This is the PR we are waiting on, You can hit the subscribe button on the right side of that screen and get update as soon as it is pulled. I will then reroll ours and push an update as well.
bigtreetech:master
← kisslorand:Avoid-sending-multiple-commands-at-once
opened 09:42AM - 30 Jan 22 UTC
### Requirements
BTT or MKS TFT.
### Description
This PR eliminates … the sending of multiple commands at once. At the moment of sending commands from the queue it is not known if there are more than one slot free in the mainboard's buffer so sending multiple ones at once can lead to missed/not received commands.
A new procedure was implemented that deals with these command groups that need to be sent together. It puts them into the command queue one by one so they will be sent one by one. If there is no room for all of them none is sent. There's a feedback of success if all of them were queued or a feedback of failure if there was an error, in which case none of them is sent. With the existing procedure it was impossible to send all of them or none of them if there was no room in the command queue.
A lot of approaches were tested to find the right balance between speed, code size and memory usage. There were techniques that gained fraction of nanoseconds but used more code or memory and there were others with less code but three times slower and so on.
### Related issues
Sending commands separately could avoid the bug discussed in issue #2295.
### Notes
For those concerned about speed here are some numbers on a BTT TFT35 v3:
Sending "M220\nM221\n" with the new procedure (5.534 microseconds) is 3.32% slower than sending separated "M220\n" and "M221\n" with the old procedure (5.356 microseconds). This means 0.178 microseconds more to put "M220\nM221\n" into the command send buffer. Just as an observation, it takes around 400 microseconds to send "M220\nM221\n" to the mainboard on UART at 250000 b/s.
vicious1
(Ryan)
February 10, 2022, 10:20pm
42
Oddly both that we need are running tests right this minute so they could be getting pulled now.
vicious1
(Ryan)
February 10, 2022, 10:27pm
43
My bad it was just updated to stay current with the main…not pulled yet.
Posted a note on my thread about the 513 firmware, did some testing this week.
513 is the skr firmware, did you also update the TFT?