|
@@ -516,6 +516,36 @@ void checkExtruderAutoFans()
|
516
|
516
|
#define WRITE_FAN(v) WRITE(FAN_PIN, v)
|
517
|
517
|
#endif
|
518
|
518
|
|
|
519
|
+inline void _temp_error(int e, const char *msg1, const char *msg2) {
|
|
520
|
+ if (!IsStopped()) {
|
|
521
|
+ SERIAL_ERROR_START;
|
|
522
|
+ if (e >= 0) SERIAL_ERRORLN((int)e);
|
|
523
|
+ serialprintPGM(msg1);
|
|
524
|
+ MYSERIAL.write('\n');
|
|
525
|
+ #ifdef ULTRA_LCD
|
|
526
|
+ lcd_setalertstatuspgm(msg2);
|
|
527
|
+ #endif
|
|
528
|
+ }
|
|
529
|
+ #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
|
|
530
|
+ Stop();
|
|
531
|
+ #endif
|
|
532
|
+}
|
|
533
|
+
|
|
534
|
+void max_temp_error(uint8_t e) {
|
|
535
|
+ disable_heater();
|
|
536
|
+ _temp_error(e, MSG_MAXTEMP_EXTRUDER_OFF, MSG_ERR_MAXTEMP);
|
|
537
|
+}
|
|
538
|
+void min_temp_error(uint8_t e) {
|
|
539
|
+ disable_heater();
|
|
540
|
+ _temp_error(e, MSG_MINTEMP_EXTRUDER_OFF, MSG_ERR_MINTEMP);
|
|
541
|
+}
|
|
542
|
+void bed_max_temp_error(void) {
|
|
543
|
+ #if HAS_HEATER_BED
|
|
544
|
+ WRITE_HEATER_BED(0);
|
|
545
|
+ #endif
|
|
546
|
+ _temp_error(-1, MSG_MAXTEMP_BED_OFF, MSG_ERR_MAXTEMP_BED);
|
|
547
|
+}
|
|
548
|
+
|
519
|
549
|
void manage_heater() {
|
520
|
550
|
|
521
|
551
|
if (!temp_meas_ready) return;
|
|
@@ -623,14 +653,7 @@ void manage_heater() {
|
623
|
653
|
#ifdef TEMP_SENSOR_1_AS_REDUNDANT
|
624
|
654
|
if (fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) {
|
625
|
655
|
disable_heater();
|
626
|
|
- if (IsStopped() == false) {
|
627
|
|
- SERIAL_ERROR_START;
|
628
|
|
- SERIAL_ERRORLNPGM(MSG_EXTRUDER_SWITCHED_OFF);
|
629
|
|
- LCD_ALERTMESSAGEPGM(MSG_ERR_REDUNDANT_TEMP); // translatable
|
630
|
|
- }
|
631
|
|
- #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
|
632
|
|
- Stop();
|
633
|
|
- #endif
|
|
656
|
+ _temp_error(-1, MSG_EXTRUDER_SWITCHED_OFF, MSG_ERR_REDUNDANT_TEMP);
|
634
|
657
|
}
|
635
|
658
|
#endif //TEMP_SENSOR_1_AS_REDUNDANT
|
636
|
659
|
|
|
@@ -1136,46 +1159,6 @@ void disable_heater() {
|
1136
|
1159
|
#endif
|
1137
|
1160
|
}
|
1138
|
1161
|
|
1139
|
|
-void max_temp_error(uint8_t e) {
|
1140
|
|
- disable_heater();
|
1141
|
|
- if(IsStopped() == false) {
|
1142
|
|
- SERIAL_ERROR_START;
|
1143
|
|
- SERIAL_ERRORLN((int)e);
|
1144
|
|
- SERIAL_ERRORLNPGM(MSG_MAXTEMP_EXTRUDER_OFF);
|
1145
|
|
- LCD_ALERTMESSAGEPGM(MSG_ERR_MAXTEMP); // translatable
|
1146
|
|
- }
|
1147
|
|
- #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
|
1148
|
|
- Stop();
|
1149
|
|
- #endif
|
1150
|
|
-}
|
1151
|
|
-
|
1152
|
|
-void min_temp_error(uint8_t e) {
|
1153
|
|
- disable_heater();
|
1154
|
|
- if(IsStopped() == false) {
|
1155
|
|
- SERIAL_ERROR_START;
|
1156
|
|
- SERIAL_ERRORLN((int)e);
|
1157
|
|
- SERIAL_ERRORLNPGM(MSG_MINTEMP_EXTRUDER_OFF);
|
1158
|
|
- LCD_ALERTMESSAGEPGM(MSG_ERR_MINTEMP); // translatable
|
1159
|
|
- }
|
1160
|
|
- #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
|
1161
|
|
- Stop();
|
1162
|
|
- #endif
|
1163
|
|
-}
|
1164
|
|
-
|
1165
|
|
-void bed_max_temp_error(void) {
|
1166
|
|
- #if HAS_HEATER_BED
|
1167
|
|
- WRITE_HEATER_BED(0);
|
1168
|
|
- #endif
|
1169
|
|
- if (IsStopped() == false) {
|
1170
|
|
- SERIAL_ERROR_START;
|
1171
|
|
- SERIAL_ERRORLNPGM(MSG_MAXTEMP_BED_OFF);
|
1172
|
|
- LCD_ALERTMESSAGEPGM(MSG_ERR_MAXTEMP_BED); // translatable
|
1173
|
|
- }
|
1174
|
|
- #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
|
1175
|
|
- Stop();
|
1176
|
|
- #endif
|
1177
|
|
-}
|
1178
|
|
-
|
1179
|
1162
|
#ifdef HEATER_0_USES_MAX6675
|
1180
|
1163
|
#define MAX6675_HEAT_INTERVAL 250
|
1181
|
1164
|
long max6675_previous_millis = MAX6675_HEAT_INTERVAL;
|