Browse Source

Fix testing of runaway options in temperature.cpp

Scott Lahteine 10 years ago
parent
commit
8332a15899
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      Marlin/temperature.cpp

+ 6
- 6
Marlin/temperature.cpp View File

73
   int current_raw_filwidth = 0;  //Holds measured filament diameter - one extruder only
73
   int current_raw_filwidth = 0;  //Holds measured filament diameter - one extruder only
74
 #endif  
74
 #endif  
75
 
75
 
76
-#if THERMAL_PROTECTION_HOTENDS || THERMAL_PROTECTION_BED
76
+#if defined(THERMAL_PROTECTION_HOTENDS) || defined(THERMAL_PROTECTION_BED)
77
   enum TRState { TRReset, TRInactive, TRFirstHeating, TRStable, TRRunaway };
77
   enum TRState { TRReset, TRInactive, TRFirstHeating, TRStable, TRRunaway };
78
   void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc);
78
   void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc);
79
-  #if THERMAL_PROTECTION_HOTENDS
79
+  #ifdef THERMAL_PROTECTION_HOTENDS
80
     static TRState thermal_runaway_state_machine[4] = { TRReset, TRReset, TRReset, TRReset };
80
     static TRState thermal_runaway_state_machine[4] = { TRReset, TRReset, TRReset, TRReset };
81
     static millis_t thermal_runaway_timer[4]; // = {0,0,0,0};
81
     static millis_t thermal_runaway_timer[4]; // = {0,0,0,0};
82
   #endif
82
   #endif
83
-  #if THERMAL_PROTECTION_BED
83
+  #ifdef THERMAL_PROTECTION_BED
84
     static TRState thermal_runaway_bed_state_machine = TRReset;
84
     static TRState thermal_runaway_bed_state_machine = TRReset;
85
     static millis_t thermal_runaway_bed_timer;
85
     static millis_t thermal_runaway_bed_timer;
86
   #endif
86
   #endif
609
   // Loop through all extruders
609
   // Loop through all extruders
610
   for (int e = 0; e < EXTRUDERS; e++) {
610
   for (int e = 0; e < EXTRUDERS; e++) {
611
 
611
 
612
-    #if THERMAL_PROTECTION_HOTENDS
612
+    #ifdef THERMAL_PROTECTION_HOTENDS
613
       thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS);
613
       thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS);
614
     #endif
614
     #endif
615
 
615
 
673
 
673
 
674
   #if TEMP_SENSOR_BED != 0
674
   #if TEMP_SENSOR_BED != 0
675
   
675
   
676
-    #if THERMAL_PROTECTION_BED
676
+    #ifdef THERMAL_PROTECTION_BED
677
       thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, -1, THERMAL_PROTECTION_BED_PERIOD, THERMAL_PROTECTION_BED_HYSTERESIS);
677
       thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, -1, THERMAL_PROTECTION_BED_PERIOD, THERMAL_PROTECTION_BED_HYSTERESIS);
678
     #endif
678
     #endif
679
 
679
 
1014
   }
1014
   }
1015
 #endif
1015
 #endif
1016
 
1016
 
1017
-#if THERMAL_PROTECTION_HOTENDS || THERMAL_PROTECTION_BED
1017
+#if defined(THERMAL_PROTECTION_HOTENDS) || defined(THERMAL_PROTECTION_BED)
1018
 
1018
 
1019
   void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) {
1019
   void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) {
1020
 
1020
 

Loading…
Cancel
Save