correcting commit errors.
This commit is contained in:
		| @@ -79,18 +79,6 @@ extern float homing_feedrate[]; | ||||
| extern bool axis_relative_modes[]; | ||||
|  | ||||
|  | ||||
| inline void kill() | ||||
| { | ||||
|   disable_heater(); | ||||
|  | ||||
|   disable_x(); | ||||
|   disable_y(); | ||||
|   disable_z(); | ||||
|   disable_e(); | ||||
|    | ||||
|   if(PS_ON_PIN > -1) pinMode(PS_ON_PIN,INPUT); | ||||
|   Serial.println("!! Printer halted. kill() called !!"); | ||||
|   while(1); // Wait for reset | ||||
| } | ||||
| void kill(); | ||||
|  | ||||
| #endif | ||||
|   | ||||
| @@ -1278,3 +1278,18 @@ void manage_inactivity(byte debug) { | ||||
|   check_axes_activity(); | ||||
| } | ||||
|  | ||||
| void kill() | ||||
| { | ||||
|   disable_heater(); | ||||
|  | ||||
|   disable_x(); | ||||
|   disable_y(); | ||||
|   disable_z(); | ||||
|   disable_e(); | ||||
|    | ||||
|   if(PS_ON_PIN > -1) pinMode(PS_ON_PIN,INPUT); | ||||
|   Serial.println("!! Printer halted. kill() called !!"); | ||||
|   while(1); // Wait for reset | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -36,6 +36,7 @@ | ||||
| #include "ultralcd.h" | ||||
| #include "streaming.h" | ||||
| #include "temperature.h" | ||||
| #include "watchdog.h" | ||||
|  | ||||
|  | ||||
| int target_raw[3] = {0, 0, 0}; | ||||
| @@ -350,6 +351,28 @@ void setWatch() | ||||
| } | ||||
|  | ||||
|  | ||||
| void disable_heater() | ||||
| { | ||||
|    #if TEMP_0_PIN > -1 | ||||
|   target_raw[0]=0; | ||||
|    #if HEATER_0_PIN > -1   | ||||
|      WRITE(HEATER_0_PIN,LOW); | ||||
|    #endif | ||||
|   #endif | ||||
|   #if TEMP_1_PIN > -1 | ||||
|   target_raw[1]=0; | ||||
|   #if HEATER_1_PIN > -1  | ||||
|     WRITE(HEATER_1_PIN,LOW); | ||||
|   #endif | ||||
|   #endif | ||||
|   #if TEMP_2_PIN > -1 | ||||
|   target_raw[2]=0; | ||||
|   #if HEATER_2_PIN > -1   | ||||
|     WRITE(HEATER_2_PIN,LOW); | ||||
|   #endif | ||||
|   #endif  | ||||
| } | ||||
|  | ||||
| // Timer 0 is shared with millies | ||||
| ISR(TIMER0_COMPB_vect) | ||||
| { | ||||
|   | ||||
| @@ -42,7 +42,7 @@ extern int target_raw[3]; | ||||
| extern int current_raw[3]; | ||||
| extern float Kp,Ki,Kd,Kc; | ||||
| #ifdef PIDTEMP | ||||
|   float pid_setpoint = 0.0; | ||||
|   extern float pid_setpoint ; | ||||
| #endif | ||||
| #ifdef WATCHPERIOD | ||||
|   extern int watch_raw[3] ; | ||||
| @@ -81,38 +81,9 @@ inline bool isCoolingHotend0() {return target_raw[TEMPSENSOR_HOTEND_0] < current | ||||
| inline bool isCoolingHotend1() {return target_raw[TEMPSENSOR_HOTEND_1] < current_raw[TEMPSENSOR_HOTEND_1];}; | ||||
| inline bool isCoolingBed() {return target_raw[TEMPSENSOR_BED] < current_raw[TEMPSENSOR_BED];}; | ||||
|  | ||||
| inline void disable_heater() | ||||
| { | ||||
|    #if TEMP_0_PIN > -1 | ||||
|   target_raw[0]=0; | ||||
|    #if HEATER_0_PIN > -1   | ||||
|      WRITE(HEATER_0_PIN,LOW); | ||||
|    #endif | ||||
|   #endif | ||||
|   #if TEMP_1_PIN > -1 | ||||
|   target_raw[1]=0; | ||||
|   #if HEATER_1_PIN > -1  | ||||
|     WRITE(HEATER_1_PIN,LOW); | ||||
|   #endif | ||||
|   #endif | ||||
|   #if TEMP_2_PIN > -1 | ||||
|   target_raw[2]=0; | ||||
|   #if HEATER_2_PIN > -1   | ||||
|     WRITE(HEATER_2_PIN,LOW); | ||||
|   #endif | ||||
|   #endif  | ||||
| } | ||||
| void setWatch() {   | ||||
|   if(isHeatingHotend0()) | ||||
|   { | ||||
|     watchmillis = max(1,millis()); | ||||
|     watch_raw[TEMPSENSOR_HOTEND_0] = current_raw[TEMPSENSOR_HOTEND_0]; | ||||
|   } | ||||
|   else | ||||
|   { | ||||
|     watchmillis = 0; | ||||
|   }  | ||||
| } | ||||
| void disable_heater(); | ||||
| void setWatch(); | ||||
|  | ||||
| #ifdef HEATER_0_USES_THERMISTOR | ||||
|     #define HEATERSOURCE 1 | ||||
| #endif | ||||
|   | ||||
| @@ -1,10 +1,13 @@ | ||||
| #ifndef __WATCHDOGH | ||||
| #define __WATCHDOGH | ||||
| #ifdef | ||||
| #include "Configuration.h" | ||||
| //#ifdef USE_WATCHDOG | ||||
|  | ||||
| /// intialise watch dog with a 1 sec interrupt time | ||||
| void wd_init(); | ||||
| /// pad the dog/reset watchdog. MUST be called at least every second after the first wd_init or avr will go into emergency procedures.. | ||||
| void wd_reset(); | ||||
|  | ||||
| //#endif | ||||
|  | ||||
| #endif | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| #ifdef USE_WATCHDOG | ||||
| 
 | ||||
| #include "watchdog.h" | ||||
| #include  <avr/wdt.h> | ||||
| #include  <avr/interrupt.h> | ||||
| 
 | ||||
		Reference in New Issue
	
	Block a user