Browse Source

The TRReset state is not needed with fall-through

Scott Lahteine 9 years ago
parent
commit
6b13c430ae
2 changed files with 4 additions and 7 deletions
  1. 1
    4
      Marlin/temperature.cpp
  2. 3
    3
      Marlin/temperature.h

+ 1
- 4
Marlin/temperature.cpp View File

1048
 
1048
 
1049
     // If the target temperature changes, restart
1049
     // If the target temperature changes, restart
1050
     if (tr_target_temperature[heater_index] != target_temperature)
1050
     if (tr_target_temperature[heater_index] != target_temperature)
1051
-      *state = TRReset;
1051
+      *state = TRInactive;
1052
 
1052
 
1053
     switch (*state) {
1053
     switch (*state) {
1054
-      case TRReset:
1055
-        *timer = 0;
1056
-        *state = TRInactive;
1057
       // Inactive state waits for a target temperature to be set
1054
       // Inactive state waits for a target temperature to be set
1058
       case TRInactive:
1055
       case TRInactive:
1059
         if (target_temperature <= 0) break;
1056
         if (target_temperature <= 0) break;

+ 3
- 3
Marlin/temperature.h View File

358
 
358
 
359
     #if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED
359
     #if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED
360
 
360
 
361
-      typedef enum TRState { TRReset, TRInactive, TRFirstHeating, TRStable, TRRunaway } TRstate;
361
+      typedef enum TRState { TRInactive, TRFirstHeating, TRStable, TRRunaway } TRstate;
362
 
362
 
363
       void thermal_runaway_protection(TRState* state, millis_t* timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc);
363
       void thermal_runaway_protection(TRState* state, millis_t* timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc);
364
 
364
 
365
       #if ENABLED(THERMAL_PROTECTION_HOTENDS)
365
       #if ENABLED(THERMAL_PROTECTION_HOTENDS)
366
-        TRState thermal_runaway_state_machine[EXTRUDERS] = { TRReset };
366
+        TRState thermal_runaway_state_machine[EXTRUDERS] = { TRInactive };
367
         millis_t thermal_runaway_timer[EXTRUDERS] = { 0 };
367
         millis_t thermal_runaway_timer[EXTRUDERS] = { 0 };
368
       #endif
368
       #endif
369
 
369
 
370
       #if HAS_THERMALLY_PROTECTED_BED
370
       #if HAS_THERMALLY_PROTECTED_BED
371
-        TRState thermal_runaway_bed_state_machine = TRReset;
371
+        TRState thermal_runaway_bed_state_machine = TRInactive;
372
         millis_t thermal_runaway_bed_timer;
372
         millis_t thermal_runaway_bed_timer;
373
       #endif
373
       #endif
374
 
374
 

Loading…
Cancel
Save