Переглянути джерело

Times can't be negative.

cardreader.cpp needs temperature.h for autotempShutdown() when
AUTOTEMP is defined but warns about unused variables.
Unpublished variables by putting them in to temperature.cpp.
AnHardt 10 роки тому
джерело
коміт
7b2550a604
2 змінених файлів з 17 додано та 16 видалено
  1. 13
    2
      Marlin/temperature.cpp
  2. 4
    14
      Marlin/temperature.h

+ 13
- 2
Marlin/temperature.cpp Переглянути файл

@@ -83,6 +83,17 @@ unsigned char soft_pwm_bed;
83 83
 #ifdef FILAMENT_SENSOR
84 84
   int current_raw_filwidth = 0;  //Holds measured filament diameter - one extruder only
85 85
 #endif  
86
+#if defined (THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0
87
+void thermal_runaway_protection(int *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc);
88
+static int thermal_runaway_state_machine[4]; // = {0,0,0,0};
89
+static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0};
90
+static bool thermal_runaway = false;
91
+#if TEMP_SENSOR_BED != 0
92
+  static int thermal_runaway_bed_state_machine;
93
+  static unsigned long thermal_runaway_bed_timer;
94
+#endif
95
+#endif
96
+
86 97
 //===========================================================================
87 98
 //=============================private variables============================
88 99
 //===========================================================================
@@ -1100,8 +1111,8 @@ void disable_heater() {
1100 1111
 }
1101 1112
 
1102 1113
 #ifdef HEATER_0_USES_MAX6675
1103
-  #define MAX6675_HEAT_INTERVAL 250
1104
-  long max6675_previous_millis = MAX6675_HEAT_INTERVAL;
1114
+  #define MAX6675_HEAT_INTERVAL 250u
1115
+  unsigned long max6675_previous_millis = MAX6675_HEAT_INTERVAL;
1105 1116
   int max6675_temp = 2000;
1106 1117
 
1107 1118
   static int read_max6675() {

+ 4
- 14
Marlin/temperature.h Переглянути файл

@@ -146,16 +146,10 @@ void disable_heater();
146 146
 void setWatch();
147 147
 void updatePID();
148 148
 
149
-#if defined (THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0
150
-void thermal_runaway_protection(int *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc);
151
-static int thermal_runaway_state_machine[4]; // = {0,0,0,0};
152
-static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0};
153
-static bool thermal_runaway = false;
154
-#if TEMP_SENSOR_BED != 0
155
-  static int thermal_runaway_bed_state_machine;
156
-  static unsigned long thermal_runaway_bed_timer;
157
-#endif
158
-#endif
149
+void PID_autotune(float temp, int extruder, int ncycles);
150
+
151
+void setExtruderAutoFanState(int pin, bool state);
152
+void checkExtruderAutoFans();
159 153
 
160 154
 FORCE_INLINE void autotempShutdown() {
161 155
   #ifdef AUTOTEMP
@@ -167,9 +161,5 @@ FORCE_INLINE void autotempShutdown() {
167 161
   #endif
168 162
 }
169 163
 
170
-void PID_autotune(float temp, int extruder, int ncycles);
171
-
172
-void setExtruderAutoFanState(int pin, bool state);
173
-void checkExtruderAutoFans();
174 164
 
175 165
 #endif

Завантаження…
Відмінити
Зберегти