Browse Source

Runout sensor without SD Card

Petr Zahradník junior 9 years ago
parent
commit
315b4c2153
2 changed files with 21 additions and 10 deletions
  1. 19
    8
      Marlin/Marlin_main.cpp
  2. 2
    2
      Marlin/SanityCheck.h

+ 19
- 8
Marlin/Marlin_main.cpp View File

4403
 
4403
 
4404
     #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
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
        * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
4408
        * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
4407
        * stand by mode, for instance in a dual extruder setup, without affecting
4409
        * stand by mode, for instance in a dual extruder setup, without affecting
4408
        * the running print timer.
4410
        * the running print timer.
4411
         print_job_timer.stop();
4413
         print_job_timer.stop();
4412
         LCD_MESSAGEPGM(WELCOME_MSG);
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
     #endif
4416
     #endif
4421
 
4417
 
4422
     if (temp > thermalManager.degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING);
4418
     if (temp > thermalManager.degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING);
4701
 
4697
 
4702
     LCD_MESSAGEPGM(MSG_BED_HEATING);
4698
     LCD_MESSAGEPGM(MSG_BED_HEATING);
4703
     bool no_wait_for_cooling = code_seen('S');
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
     #if TEMP_BED_RESIDENCY_TIME > 0
4717
     #if TEMP_BED_RESIDENCY_TIME > 0
4707
       millis_t residency_start_ms = 0;
4718
       millis_t residency_start_ms = 0;
8112
 void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
8123
 void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
8113
 
8124
 
8114
   #if ENABLED(FILAMENT_RUNOUT_SENSOR)
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
       handle_filament_runout();
8127
       handle_filament_runout();
8117
   #endif
8128
   #endif
8118
 
8129
 

+ 2
- 2
Marlin/SanityCheck.h View File

111
 #endif
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
 #if ENABLED(FILAMENT_RUNOUT_SENSOR)
116
 #if ENABLED(FILAMENT_RUNOUT_SENSOR)
117
   #if !HAS_FIL_RUNOUT
117
   #if !HAS_FIL_RUNOUT
118
     #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
118
     #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
119
-  #elif DISABLED(SDSUPPORT)
119
+  #elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART)
120
     #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT."
120
     #error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT."
121
   #endif
121
   #endif
122
 #endif
122
 #endif

Loading…
Cancel
Save