Pārlūkot izejas kodu

new timout/add adv_ok

Wurstnase 10 gadus atpakaļ
vecāks
revīzija
92575cecca
2 mainītis faili ar 13 papildinājumiem un 5 dzēšanām
  1. 7
    3
      Marlin/Configuration_adv.h
  2. 6
    2
      Marlin/Marlin_main.cpp

+ 7
- 3
Marlin/Configuration_adv.h Parādīt failu

374
 #define MAX_CMD_SIZE 96
374
 #define MAX_CMD_SIZE 96
375
 #define BUFSIZE 4
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
 // @section fwretract
385
 // @section fwretract
382
 
386
 

+ 6
- 2
Marlin/Marlin_main.cpp Parādīt failu

728
     static millis_t last_command_time = 0;
728
     static millis_t last_command_time = 0;
729
     millis_t ms = millis();
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
       SERIAL_ECHOLNPGM(MSG_WAIT);
732
       SERIAL_ECHOLNPGM(MSG_WAIT);
733
       last_command_time = ms;
733
       last_command_time = ms;
734
     }
734
     }
5299
   #ifdef SDSUPPORT
5299
   #ifdef SDSUPPORT
5300
     if (fromsd[cmd_queue_index_r]) return;
5300
     if (fromsd[cmd_queue_index_r]) return;
5301
   #endif
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
 void get_coordinates() {
5309
 void get_coordinates() {

Notiek ielāde…
Atcelt
Saglabāt