소스 검색

make 'wait' optional and mark as workaround

Wurstnase 10 년 전
부모
커밋
b09a957fce
2개의 변경된 파일15개의 추가작업 그리고 7개의 파일을 삭제
  1. 4
    0
      Marlin/Configuration_adv.h
  2. 11
    7
      Marlin/Marlin_main.cpp

+ 4
- 0
Marlin/Configuration_adv.h 파일 보기

@@ -374,6 +374,10 @@ 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
380
+
377 381
 // @section fwretract
378 382
 
379 383
 // Firmware based and LCD controlled retract

+ 11
- 7
Marlin/Marlin_main.cpp 파일 보기

@@ -724,16 +724,20 @@ void get_command() {
724 724
 
725 725
   if (drain_queued_commands_P()) return; // priority is given to non-serial commands
726 726
   
727
-  static millis_t last_command_time = 0;
728
-  millis_t ms = millis();
727
+  #ifdef NO_TIMEOUTS
728
+    static millis_t last_command_time = 0;
729
+    millis_t ms = millis();
729 730
   
730
-  if (!MYSERIAL.available() && commands_in_queue == 0 && ms - last_command_time > 1000) {
731
-    SERIAL_ECHOLNPGM(MSG_WAIT);
732
-    last_command_time = ms;
733
-  }
731
+    if (!MYSERIAL.available() && commands_in_queue == 0 && ms - last_command_time > 1000) {
732
+      SERIAL_ECHOLNPGM(MSG_WAIT);
733
+      last_command_time = ms;
734
+    }
735
+  #endif
734 736
   
735 737
   while (MYSERIAL.available() > 0 && commands_in_queue < BUFSIZE) {
736
-    last_command_time = ms;
738
+    #ifdef NO_TIMEOUTS
739
+      last_command_time = ms;
740
+    #endif
737 741
     serial_char = MYSERIAL.read();
738 742
 
739 743
     if (serial_char == '\n' || serial_char == '\r' ||

Loading…
취소
저장