Browse Source

Changed the type of variable to bool, the name to "cancel_heatup", flags implementation and added this fix to M190 gcode too.

pull/1/head
Pablo Clemente 11 years ago
parent
commit
d86c3cf43c
  1. 9
      Marlin/Marlin_main.cpp
  2. 6
      Marlin/ultralcd.cpp
  3. 2
      Marlin/ultralcd.h

9
Marlin/Marlin_main.cpp

@ -1946,14 +1946,14 @@ void process_commands()
/* See if we are heating up or cooling down */ /* See if we are heating up or cooling down */
target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling
forced_heating_stop = false; cancel_heatup = false;
#ifdef TEMP_RESIDENCY_TIME #ifdef TEMP_RESIDENCY_TIME
long residencyStart; long residencyStart;
residencyStart = -1; residencyStart = -1;
/* continue to loop until we have reached the target temp /* continue to loop until we have reached the target temp
_and_ until TEMP_RESIDENCY_TIME hasn't passed since we reached it */ _and_ until TEMP_RESIDENCY_TIME hasn't passed since we reached it */
while((forced_heating_stop == false)&&((residencyStart == -1) || while((!cancel_heatup)&&((residencyStart == -1) ||
(residencyStart >= 0 && (((unsigned int) (millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL)))) ) { (residencyStart >= 0 && (((unsigned int) (millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL)))) ) {
#else #else
while ( target_direction ? (isHeatingHotend(tmp_extruder)) : (isCoolingHotend(tmp_extruder)&&(CooldownNoWait==false)) ) { while ( target_direction ? (isHeatingHotend(tmp_extruder)) : (isCoolingHotend(tmp_extruder)&&(CooldownNoWait==false)) ) {
@ -2010,10 +2010,11 @@ void process_commands()
CooldownNoWait = false; CooldownNoWait = false;
} }
codenum = millis(); codenum = millis();
cancel_heatup = false;
target_direction = isHeatingBed(); // true if heating, false if cooling target_direction = isHeatingBed(); // true if heating, false if cooling
while ( target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false)) ) while ( (target_direction)&&(!cancel_heatup) ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false)) )
{ {
if(( millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up. if(( millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up.
{ {

6
Marlin/ultralcd.cpp

@ -19,7 +19,7 @@ int absPreheatHotendTemp;
int absPreheatHPBTemp; int absPreheatHPBTemp;
int absPreheatFanSpeed; int absPreheatFanSpeed;
boolean forced_heating_stop = false ; bool cancel_heatup = false ;
#ifdef ULTIPANEL #ifdef ULTIPANEL
static float manual_feedrate[] = MANUAL_FEEDRATE; static float manual_feedrate[] = MANUAL_FEEDRATE;
@ -195,7 +195,7 @@ static void lcd_status_screen()
currentMenu = lcd_main_menu; currentMenu = lcd_main_menu;
encoderPosition = 0; encoderPosition = 0;
lcd_quick_feedback(); lcd_quick_feedback();
lcd_implementation_init(); // to maybe revive the LCD if static electricity killed it. lcd_implementation_init(); // to maybe revive the LCD if static electricity killed it.
} }
#ifdef ULTIPANEL_FEEDMULTIPLY #ifdef ULTIPANEL_FEEDMULTIPLY
@ -258,7 +258,7 @@ static void lcd_sdcard_stop()
} }
autotempShutdown(); autotempShutdown();
forced_heating_stop = true; cancel_heatup = true;
} }
/* Menu implementation */ /* Menu implementation */

2
Marlin/ultralcd.h

@ -43,7 +43,7 @@
extern int absPreheatHPBTemp; extern int absPreheatHPBTemp;
extern int absPreheatFanSpeed; extern int absPreheatFanSpeed;
extern boolean forced_heating_stop; extern bool cancel_heatup;
void lcd_buzz(long duration,uint16_t freq); void lcd_buzz(long duration,uint16_t freq);
bool lcd_clicked(); bool lcd_clicked();

Loading…
Cancel
Save