Selaa lähdekoodia

new timout/add adv_ok

Wurstnase 10 vuotta sitten
vanhempi
commit
92575cecca
2 muutettua tiedostoa jossa 13 lisäystä ja 5 poistoa
  1. 7
    3
      Marlin/Configuration_adv.h
  2. 6
    2
      Marlin/Marlin_main.cpp

+ 7
- 3
Marlin/Configuration_adv.h Näytä tiedosto

@@ -374,9 +374,13 @@ const unsigned int dropsegments=5; //everything with less than this number of st
374 374
 #define MAX_CMD_SIZE 96
375 375
 #define BUFSIZE 4
376 376
 
377
-// Some Hosts doesn't have a timeout for resend a command.
378
-// This is a workaround for them. If your printer sometimes stuck and stop printing this could help.
379
-// #define NO_TIMEOUTS
377
+// Bad Serial-connections can miss a received command by sending an 'ok'
378
+// Therefore some clients go after 30 seconds in a timeout. Some other clients start sending commands while receiving a 'wait'.
379
+// This wait is only send when the buffer is empty. The timeout-length is in milliseconds. 1000 is a good value.
380
+// #define NO_TIMEOUTS 1000
381
+
382
+// Some clients will have this feature soon. This should make the NO_TIMEOUTS unnecessary.
383
+// #define ADVANCED_OK
380 384
 
381 385
 // @section fwretract
382 386
 

+ 6
- 2
Marlin/Marlin_main.cpp Näytä tiedosto

@@ -728,7 +728,7 @@ void get_command() {
728 728
     static millis_t last_command_time = 0;
729 729
     millis_t ms = millis();
730 730
   
731
-    if (!MYSERIAL.available() && commands_in_queue == 0 && ms - last_command_time > 1000) {
731
+    if (!MYSERIAL.available() && commands_in_queue == 0 && ms - last_command_time > NO_TIMEOUTS) {
732 732
       SERIAL_ECHOLNPGM(MSG_WAIT);
733 733
       last_command_time = ms;
734 734
     }
@@ -5299,7 +5299,11 @@ void ClearToSend() {
5299 5299
   #ifdef SDSUPPORT
5300 5300
     if (fromsd[cmd_queue_index_r]) return;
5301 5301
   #endif
5302
-  SERIAL_PROTOCOLLNPGM(MSG_OK);
5302
+  SERIAL_PROTOCOLPGM(MSG_OK);
5303
+  #ifdef ADVANCED_OK
5304
+    SERIAL_PROTOCOLPGM(" N"); SERIAL_PROTOCOL(gcode_LastN);
5305
+    SERIAL_PROTOCOLPGM(" S"); SERIAL_PROTOCOLLN(commands_in_queue);
5306
+  #endif
5303 5307
 }
5304 5308
 
5305 5309
 void get_coordinates() {

Loading…
Peruuta
Tallenna