Browse Source

added KILL_PIN support / cleaned up manage_inactivity function definition

stohn 13 years ago
parent
commit
de0448343f
4 changed files with 32 additions and 20 deletions
  1. 1
    1
      Marlin/Marlin.h
  2. 29
    17
      Marlin/Marlin.pde
  3. 1
    1
      Marlin/planner.cpp
  4. 1
    1
      Marlin/stepper.cpp

+ 1
- 1
Marlin/Marlin.h View File

107
 void get_command();
107
 void get_command();
108
 void process_commands();
108
 void process_commands();
109
 
109
 
110
-void manage_inactivity(byte debug);
110
+void manage_inactivity();
111
 
111
 
112
 #if X_ENABLE_PIN > -1
112
 #if X_ENABLE_PIN > -1
113
   #define  enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
113
   #define  enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)

+ 29
- 17
Marlin/Marlin.pde View File

245
   }
245
   }
246
 }
246
 }
247
 
247
 
248
+void setup_killpin()
249
+{
250
+  #if( KILL_PIN>-1 )
251
+    pinMode(KILL_PIN,INPUT);
252
+    WRITE(KILL_PIN,HIGH);
253
+  #endif
254
+}
255
+    
248
 void setup_photpin()
256
 void setup_photpin()
249
 {
257
 {
250
   #ifdef PHOTOGRAPH_PIN
258
   #ifdef PHOTOGRAPH_PIN
276
 }
284
 }
277
 
285
 
278
 void setup()
286
 void setup()
279
-{ 
287
+{
288
+  setup_killpin(); 
280
   setup_powerhold();
289
   setup_powerhold();
281
   MYSERIAL.begin(BAUDRATE);
290
   MYSERIAL.begin(BAUDRATE);
282
   SERIAL_PROTOCOLLNPGM("start");
291
   SERIAL_PROTOCOLLNPGM("start");
365
   }
374
   }
366
   //check heater every n milliseconds
375
   //check heater every n milliseconds
367
   manage_heater();
376
   manage_heater();
368
-  manage_inactivity(1);
377
+  manage_inactivity();
369
   checkHitEndstops();
378
   checkHitEndstops();
370
   LCD_STATUS;
379
   LCD_STATUS;
371
 }
380
 }
653
       previous_millis_cmd = millis();
662
       previous_millis_cmd = millis();
654
       while(millis()  < codenum ){
663
       while(millis()  < codenum ){
655
         manage_heater();
664
         manage_heater();
656
-        manage_inactivity(1);
657
-		LCD_STATUS;
665
+        manage_inactivity();
666
+        LCD_STATUS;
658
       }
667
       }
659
       break;
668
       break;
660
       #ifdef FWRETRACT  
669
       #ifdef FWRETRACT  
816
       
825
       
817
       st_synchronize();
826
       st_synchronize();
818
       previous_millis_cmd = millis();
827
       previous_millis_cmd = millis();
819
-	  if (codenum > 0)
820
-	  {
828
+      if (codenum > 0){
821
         codenum += millis();  // keep track of when we started waiting
829
         codenum += millis();  // keep track of when we started waiting
822
         while(millis()  < codenum && !CLICKED){
830
         while(millis()  < codenum && !CLICKED){
823
           manage_heater();
831
           manage_heater();
824
-          manage_inactivity(1);
825
-		  LCD_STATUS;
826
-		}
832
+          manage_inactivity();
833
+          LCD_STATUS;
834
+        }
827
       }else{
835
       }else{
828
-        while(!CLICKED) {
836
+        while(!CLICKED){
829
           manage_heater();
837
           manage_heater();
830
-          manage_inactivity(1);
831
-		  LCD_STATUS;
832
-		}
833
-	  }
838
+          manage_inactivity();
839
+          LCD_STATUS;
840
+        }
841
+      }
834
     }
842
     }
835
     break;
843
     break;
836
 #endif
844
 #endif
1064
             codenum = millis();
1072
             codenum = millis();
1065
           }
1073
           }
1066
           manage_heater();
1074
           manage_heater();
1067
-          manage_inactivity(1);
1075
+          manage_inactivity();
1068
           LCD_STATUS;
1076
           LCD_STATUS;
1069
         #ifdef TEMP_RESIDENCY_TIME
1077
         #ifdef TEMP_RESIDENCY_TIME
1070
             /* start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time
1078
             /* start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time
1102
             codenum = millis(); 
1110
             codenum = millis(); 
1103
           }
1111
           }
1104
           manage_heater();
1112
           manage_heater();
1105
-          manage_inactivity(1);
1113
+          manage_inactivity();
1106
           LCD_STATUS;
1114
           LCD_STATUS;
1107
         }
1115
         }
1108
         LCD_MESSAGEPGM(MSG_BED_DONE);
1116
         LCD_MESSAGEPGM(MSG_BED_DONE);
1664
 }
1672
 }
1665
 #endif
1673
 #endif
1666
 
1674
 
1667
-void manage_inactivity(byte debug) 
1675
+void manage_inactivity() 
1668
 { 
1676
 { 
1669
   if( (millis() - previous_millis_cmd) >  max_inactive_time ) 
1677
   if( (millis() - previous_millis_cmd) >  max_inactive_time ) 
1670
     if(max_inactive_time) 
1678
     if(max_inactive_time) 
1682
       }
1690
       }
1683
     }
1691
     }
1684
   }
1692
   }
1693
+  #if( KILL_PIN>-1 )
1694
+    if( 0 == READ(KILL_PIN) )
1695
+      kill();
1696
+  #endif
1685
   #ifdef CONTROLLERFAN_PIN
1697
   #ifdef CONTROLLERFAN_PIN
1686
     controllerFan(); //Check if fan should be turned on to cool stepper drivers down
1698
     controllerFan(); //Check if fan should be turned on to cool stepper drivers down
1687
   #endif
1699
   #endif

+ 1
- 1
Marlin/planner.cpp View File

501
   // Rest here until there is room in the buffer.
501
   // Rest here until there is room in the buffer.
502
   while(block_buffer_tail == next_buffer_head) { 
502
   while(block_buffer_tail == next_buffer_head) { 
503
     manage_heater(); 
503
     manage_heater(); 
504
-    manage_inactivity(1); 
504
+    manage_inactivity(); 
505
     LCD_STATUS;
505
     LCD_STATUS;
506
   }
506
   }
507
 
507
 

+ 1
- 1
Marlin/stepper.cpp View File

899
 {
899
 {
900
     while( blocks_queued()) {
900
     while( blocks_queued()) {
901
     manage_heater();
901
     manage_heater();
902
-    manage_inactivity(1);
902
+    manage_inactivity();
903
     LCD_STATUS;
903
     LCD_STATUS;
904
   }
904
   }
905
 }
905
 }

Loading…
Cancel
Save