From 0cb87795a30919b96aa4f098ace7ef7f84d6e7f7 Mon Sep 17 00:00:00 2001
From: Wurstnase <tonnhofer@gmail.com>
Date: Fri, 8 May 2015 22:28:51 +0200
Subject: [PATCH] advanced 'ok'

ok N(linenumber) P(bufferremaining)
the host can use this to send the data much faster.

Some pseudo code:
If (bufferremaining > 0)  send command
## as long there is free buffer send command

Also
if (linenumber > lastsend - bufferremaining) send command
## as long last linenumber received is bigger than lastsend (host) - last bufferremaining received
---
 Marlin/Marlin_main.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp
index 2319fe87fb..19bec369ba 100644
--- a/Marlin/Marlin_main.cpp
+++ b/Marlin/Marlin_main.cpp
@@ -5533,8 +5533,9 @@ void ClearToSend() {
   SERIAL_PROTOCOLPGM(MSG_OK);
   #ifdef ADVANCED_OK
     SERIAL_PROTOCOLPGM(" N"); SERIAL_PROTOCOL(gcode_LastN);
-    SERIAL_PROTOCOLPGM(" S"); SERIAL_PROTOCOLLN(commands_in_queue);
+    SERIAL_PROTOCOLPGM(" P"); SERIAL_PROTOCOL(BUFSIZE - commands_in_queue);
   #endif
+  SERIAL_PROTOCOLLNPGM("");  
 }
 
 void get_coordinates() {
-- 
GitLab