Browse Source

Fix tr_target_temperature type - float!

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

+ 6
- 6
Marlin/temperature.cpp View File

1007
 
1007
 
1008
   void thermal_runaway_protection(TRState *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) {
1008
   void thermal_runaway_protection(TRState *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) {
1009
 
1009
 
1010
-    static int tr_target_temperature[EXTRUDERS+1];
1010
+    static float tr_target_temperature[EXTRUDERS+1];
1011
 
1011
 
1012
     /*
1012
     /*
1013
         SERIAL_ECHO_START;
1013
         SERIAL_ECHO_START;
1053
         }
1053
         }
1054
 
1054
 
1055
         // If the temperature is over the target (-hysteresis) restart the timer
1055
         // If the temperature is over the target (-hysteresis) restart the timer
1056
-        if (temperature >= tr_target_temperature[heater_index] - hysteresis_degc) *timer = millis();
1057
-
1058
-        // If the timer goes too long without a reset, trigger shutdown
1056
+        if (temperature >= tr_target_temperature[heater_index] - hysteresis_degc) {
1057
+          *timer = millis();
1058
+        } // If the timer goes too long without a reset, trigger shutdown
1059
         else if (millis() > *timer + period_seconds * 1000UL) {
1059
         else if (millis() > *timer + period_seconds * 1000UL) {
1060
           SERIAL_ERROR_START;
1060
           SERIAL_ERROR_START;
1061
           SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP);
1061
           SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP);
1062
           if (heater_id < 0) SERIAL_ERRORLNPGM("bed"); else SERIAL_ERRORLN(heater_id);
1062
           if (heater_id < 0) SERIAL_ERRORLNPGM("bed"); else SERIAL_ERRORLN(heater_id);
1063
           LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY);
1063
           LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY);
1064
           thermal_runaway = true;
1064
           thermal_runaway = true;
1065
+          disable_heater();
1066
+          disable_all_steppers();
1065
           for (;;) {
1067
           for (;;) {
1066
-            disable_heater();
1067
-            disable_all_steppers();
1068
             manage_heater();
1068
             manage_heater();
1069
             lcd_update();
1069
             lcd_update();
1070
           }
1070
           }

Loading…
Cancel
Save