chiark / gitweb /
cooldown blocking selectable by #define.
authorBernhard <bkubicek@x201.(none)>
Sat, 26 Nov 2011 08:03:12 +0000 (09:03 +0100)
committerBernhard <bkubicek@x201.(none)>
Sat, 26 Nov 2011 08:03:12 +0000 (09:03 +0100)
Marlin/Configuration.h
Marlin/Marlin.pde

index f8bb40e12eca2e91f3a3d31445317836a80d909f..4dea777cf9af9419fbf566b16ceebebda6ccc569 100644 (file)
 //#define BED_MAXTEMP 150
 
 
+// Wait for Cooldown
+// This defines if the M109 call should not block if it is cooling down.
+// example: From a current temp of 220, you set M109 S200. 
+// if CooldownNoWait is defined M109 will not wait for the cooldown to finish
+#define CooldownNoWait true
 
 // PID settings:
 // Uncomment the following line to enable PID support.
index 381d6aa9b474e262dcdc5fcb9e42b0027e6b8719..60ec2b22e5472d6eb441f2f12065beb12849aa11 100644 (file)
@@ -517,7 +517,10 @@ inline void process_commands()
       codenum = 0;
       if(code_seen('P')) codenum = code_value(); // milliseconds to wait
       if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait
+      
+      st_synchronize();
       codenum += millis();  // keep track of when we started waiting
+      
       while(millis()  < codenum ){
         manage_heater();
       }
@@ -579,7 +582,7 @@ inline void process_commands()
 
     switch( (int)code_value() ) 
     {
-       case 17:
+    case 17:
         LCD_MESSAGEPGM("No move.");
         enable_x(); 
         enable_y(); 
@@ -740,7 +743,7 @@ inline void process_commands()
           while((target_direction ? (isHeatingHotend0()) : (isCoolingHotend0())) ||
                   (residencyStart > -1 && (millis() - residencyStart) < TEMP_RESIDENCY_TIME*1000) ) {
         #else
-          while ( target_direction ? (isHeatingHotend0()) : (isCoolingHotend0()) ) {
+          while ( target_direction ? (isHeatingHotend0()) : (isCoolingHotend0()&&(CooldownNoWait==false)) ) {
         #endif //TEMP_RESIDENCY_TIME
         if( (millis() - codenum) > 1000 ) 
         { //Print Temp Reading every 1 second while heating up/cooling down