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

+ 4
- 1
Marlin/ultralcd.cpp View File

19
 int absPreheatHPBTemp;
19
 int absPreheatHPBTemp;
20
 int absPreheatFanSpeed;
20
 int absPreheatFanSpeed;
21
 
21
 
22
+bool cancel_heatup = false ;
22
 
23
 
23
 #ifdef ULTIPANEL
24
 #ifdef ULTIPANEL
24
 static float manual_feedrate[] = MANUAL_FEEDRATE;
25
 static float manual_feedrate[] = MANUAL_FEEDRATE;
194
         currentMenu = lcd_main_menu;
195
         currentMenu = lcd_main_menu;
195
         encoderPosition = 0;
196
         encoderPosition = 0;
196
         lcd_quick_feedback();
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
 #ifdef ULTIPANEL_FEEDMULTIPLY
201
 #ifdef ULTIPANEL_FEEDMULTIPLY
256
         enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND));
257
         enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND));
257
     }
258
     }
258
     autotempShutdown();
259
     autotempShutdown();
260
+    
261
+    cancel_heatup = true;
259
 }
262
 }
260
 
263
 
261
 /* Menu implementation */
264
 /* Menu implementation */

+ 2
- 0
Marlin/ultralcd.h View File

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

Loading…
Cancel
Save