Преглед на файлове

Runout sensor without SD Card

Petr Zahradník junior преди 8 години
родител
ревизия
315b4c2153
променени са 2 файла, в които са добавени 21 реда и са изтрити 10 реда
  1. 19
    8
      Marlin/Marlin_main.cpp
  2. 2
    2
      Marlin/SanityCheck.h

+ 19
- 8
Marlin/Marlin_main.cpp Целия файл

@@ -4403,6 +4403,8 @@ inline void gcode_M104() {
4403 4403
 
4404 4404
     #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
4405 4405
       /**
4406
+       * Stop the timer at the end of print, starting is managed by 
4407
+       * 'heat and wait' M109.
4406 4408
        * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
4407 4409
        * stand by mode, for instance in a dual extruder setup, without affecting
4408 4410
        * the running print timer.
@@ -4411,12 +4413,6 @@ inline void gcode_M104() {
4411 4413
         print_job_timer.stop();
4412 4414
         LCD_MESSAGEPGM(WELCOME_MSG);
4413 4415
       }
4414
-      /**
4415
-       * We do not check if the timer is already running because this check will
4416
-       * be done for us inside the Stopwatch::start() method thus a running timer
4417
-       * will not restart.
4418
-       */
4419
-      else print_job_timer.start();
4420 4416
     #endif
4421 4417
 
4422 4418
     if (temp > thermalManager.degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING);
@@ -4701,7 +4697,22 @@ inline void gcode_M109() {
4701 4697
 
4702 4698
     LCD_MESSAGEPGM(MSG_BED_HEATING);
4703 4699
     bool no_wait_for_cooling = code_seen('S');
4704
-    if (no_wait_for_cooling || code_seen('R')) thermalManager.setTargetBed(code_value_temp_abs());
4700
+    if (no_wait_for_cooling || code_seen('R')) {
4701
+      thermalManager.setTargetBed(code_value_temp_abs());
4702
+      #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
4703
+        if(code_value_temp_abs() > BED_MINTEMP) {
4704
+          /**
4705
+          * We start the timer when 'heating and waiting' command arrives, LCD 
4706
+          * functions never wait. Cooling down managed by extruders.
4707
+          *
4708
+          * We do not check if the timer is already running because this check will
4709
+          * be done for us inside the Stopwatch::start() method thus a running timer
4710
+          * will not restart.
4711
+          */
4712
+          print_job_timer.start();
4713
+        }
4714
+      #endif
4715
+    }
4705 4716
 
4706 4717
     #if TEMP_BED_RESIDENCY_TIME > 0
4707 4718
       millis_t residency_start_ms = 0;
@@ -8112,7 +8123,7 @@ void idle(
8112 8123
 void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
8113 8124
 
8114 8125
   #if ENABLED(FILAMENT_RUNOUT_SENSOR)
8115
-    if (IS_SD_PRINTING && !(READ(FIL_RUNOUT_PIN) ^ FIL_RUNOUT_INVERTING))
8126
+    if ((IS_SD_PRINTING || print_job_timer.isRunning()) && !(READ(FIL_RUNOUT_PIN) ^ FIL_RUNOUT_INVERTING))
8116 8127
       handle_filament_runout();
8117 8128
   #endif
8118 8129
 

+ 2
- 2
Marlin/SanityCheck.h Целия файл

@@ -111,12 +111,12 @@
111 111
 #endif
112 112
 
113 113
 /**
114
- * Filament Runout needs a pin and SD Support
114
+ * Filament Runout needs a pin and either SD Support or Auto print start detection
115 115
  */
116 116
 #if ENABLED(FILAMENT_RUNOUT_SENSOR)
117 117
   #if !HAS_FIL_RUNOUT
118 118
     #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
119
-  #elif DISABLED(SDSUPPORT)
119
+  #elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART)
120 120
     #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT."
121 121
   #endif
122 122
 #endif

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