wurstnase преди 10 години
родител
ревизия
574e2d856e
променени са 2 файла, в които са добавени 10 реда и са изтрити 1 реда
  1. 9
    1
      Marlin/Marlin_main.cpp
  2. 1
    0
      Marlin/language.h

+ 9
- 1
Marlin/Marlin_main.cpp Целия файл

263
 static millis_t stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME * 1000L;
263
 static millis_t stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME * 1000L;
264
 millis_t print_job_start_ms = 0; ///< Print job start time
264
 millis_t print_job_start_ms = 0; ///< Print job start time
265
 millis_t print_job_stop_ms = 0;  ///< Print job stop time
265
 millis_t print_job_stop_ms = 0;  ///< Print job stop time
266
+static millis_t last_command_time = 0;
266
 static uint8_t target_extruder;
267
 static uint8_t target_extruder;
267
 bool no_wait_for_cooling = true;
268
 bool no_wait_for_cooling = true;
268
 bool target_direction;
269
 bool target_direction;
724
 
725
 
725
   if (drain_queued_commands_P()) return; // priority is given to non-serial commands
726
   if (drain_queued_commands_P()) return; // priority is given to non-serial commands
726
   
727
   
728
+  millis_t ms = millis();
729
+  
730
+  if (!MYSERIAL.available() && commands_in_queue == 0 && ms - last_command_time > 1000) {
731
+    SERIAL_ECHOLNPGM(MSG_WAIT);
732
+    last_command_time = ms;
733
+  }
734
+  
727
   while (MYSERIAL.available() > 0 && commands_in_queue < BUFSIZE) {
735
   while (MYSERIAL.available() > 0 && commands_in_queue < BUFSIZE) {
728
-
736
+    last_command_time = ms;
729
     serial_char = MYSERIAL.read();
737
     serial_char = MYSERIAL.read();
730
 
738
 
731
     if (serial_char == '\n' || serial_char == '\r' ||
739
     if (serial_char == '\n' || serial_char == '\r' ||

+ 1
- 0
Marlin/language.h Целия файл

121
 #define MSG_FREE_MEMORY                     " Free Memory: "
121
 #define MSG_FREE_MEMORY                     " Free Memory: "
122
 #define MSG_PLANNER_BUFFER_BYTES            "  PlannerBufferBytes: "
122
 #define MSG_PLANNER_BUFFER_BYTES            "  PlannerBufferBytes: "
123
 #define MSG_OK                              "ok"
123
 #define MSG_OK                              "ok"
124
+#define MSG_WAIT                            "wait"
124
 #define MSG_FILE_SAVED                      "Done saving file."
125
 #define MSG_FILE_SAVED                      "Done saving file."
125
 #define MSG_ERR_LINE_NO                     "Line Number is not Last Line Number+1, Last Line: "
126
 #define MSG_ERR_LINE_NO                     "Line Number is not Last Line Number+1, Last Line: "
126
 #define MSG_ERR_CHECKSUM_MISMATCH           "checksum mismatch, Last Line: "
127
 #define MSG_ERR_CHECKSUM_MISMATCH           "checksum mismatch, Last Line: "

Loading…
Отказ
Запис