Browse Source

Merge pull request #965 from bq/forced_heating_stop

Fixed stop print LCD function on M104
daid 11 years ago
parent
commit
4c823224b0
3 changed files with 13 additions and 5 deletions
  1. 7
    4
      Marlin/Marlin_main.cpp
  2. 4
    1
      Marlin/ultralcd.cpp
  3. 2
    0
      Marlin/ultralcd.h

+ 7
- 4
Marlin/Marlin_main.cpp View File

@@ -1945,14 +1945,16 @@ void process_commands()
1945 1945
 
1946 1946
       /* See if we are heating up or cooling down */
1947 1947
       target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling
1948
+      
1949
+      cancel_heatup = false;
1948 1950
 
1949 1951
       #ifdef TEMP_RESIDENCY_TIME
1950 1952
         long residencyStart;
1951 1953
         residencyStart = -1;
1952 1954
         /* continue to loop until we have reached the target temp
1953 1955
           _and_ until TEMP_RESIDENCY_TIME hasn't passed since we reached it */
1954
-        while((residencyStart == -1) ||
1955
-              (residencyStart >= 0 && (((unsigned int) (millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))) ) {
1956
+        while((!cancel_heatup)&&((residencyStart == -1) ||
1957
+              (residencyStart >= 0 && (((unsigned int) (millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL)))) ) {
1956 1958
       #else
1957 1959
         while ( target_direction ? (isHeatingHotend(tmp_extruder)) : (isCoolingHotend(tmp_extruder)&&(CooldownNoWait==false)) ) {
1958 1960
       #endif //TEMP_RESIDENCY_TIME
@@ -2008,10 +2010,11 @@ void process_commands()
2008 2010
           CooldownNoWait = false;
2009 2011
         }
2010 2012
         codenum = millis();
2011
-
2013
+        
2014
+        cancel_heatup = false;
2012 2015
         target_direction = isHeatingBed(); // true if heating, false if cooling
2013 2016
 
2014
-        while ( target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false)) )
2017
+        while ( (target_direction)&&(!cancel_heatup) ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false)) )
2015 2018
         {
2016 2019
           if(( millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
2017 2020
           {

+ 4
- 1
Marlin/ultralcd.cpp View File

@@ -19,6 +19,7 @@ int absPreheatHotendTemp;
19 19
 int absPreheatHPBTemp;
20 20
 int absPreheatFanSpeed;
21 21
 
22
+bool cancel_heatup = false ;
22 23
 
23 24
 #ifdef ULTIPANEL
24 25
 static float manual_feedrate[] = MANUAL_FEEDRATE;
@@ -194,7 +195,7 @@ static void lcd_status_screen()
194 195
         currentMenu = lcd_main_menu;
195 196
         encoderPosition = 0;
196 197
         lcd_quick_feedback();
197
-        lcd_implementation_init(); // to maybe revive the LCD if static electricity killed it.
198
+        lcd_implementation_init(); // to maybe revive the LCD if static electricity killed it.
198 199
     }
199 200
 
200 201
 #ifdef ULTIPANEL_FEEDMULTIPLY
@@ -256,6 +257,8 @@ static void lcd_sdcard_stop()
256 257
         enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND));
257 258
     }
258 259
     autotempShutdown();
260
+    
261
+    cancel_heatup = true;
259 262
 }
260 263
 
261 264
 /* Menu implementation */

+ 2
- 0
Marlin/ultralcd.h View File

@@ -42,6 +42,8 @@
42 42
   extern int absPreheatHotendTemp;
43 43
   extern int absPreheatHPBTemp;
44 44
   extern int absPreheatFanSpeed;
45
+  
46
+  extern bool cancel_heatup;
45 47
     
46 48
   void lcd_buzz(long duration,uint16_t freq);
47 49
   bool lcd_clicked();

Loading…
Cancel
Save