Quellcode durchsuchen

Fix thermal error protection, reporting (#20655)

Marcio T vor 4 Jahren
Ursprung
Commit
2d88bcb67e
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden

+ 1
- 3
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_player.cpp Datei anzeigen

@@ -75,9 +75,7 @@ namespace FTDI {
75 75
 
76 76
     while (has_more_notes()) {
77 77
       onIdle();
78
-      #ifdef EXTENSIBLE_UI
79
-        ExtUI::yield();
80
-      #endif
78
+      TERN_(TOUCH_UI_FTDI_EVE, ExtUI::yield());
81 79
     }
82 80
   }
83 81
 

+ 18
- 10
Marlin/src/module/temperature.cpp Datei anzeigen

@@ -793,9 +793,16 @@ int16_t Temperature::getHeaterPower(const heater_id_t heater_id) {
793 793
 inline void loud_kill(PGM_P const lcd_msg, const heater_id_t heater_id) {
794 794
   marlin_state = MF_KILLED;
795 795
   #if USE_BEEPER
796
+    thermalManager.disable_all_heaters();
796 797
     for (uint8_t i = 20; i--;) {
797
-      WRITE(BEEPER_PIN, HIGH); delay(25);
798
-      WRITE(BEEPER_PIN, LOW); delay(80);
798
+      WRITE(BEEPER_PIN, HIGH);
799
+      delay(25);
800
+      watchdog_refresh();
801
+      WRITE(BEEPER_PIN, LOW);
802
+      delay(40);
803
+      watchdog_refresh();
804
+      delay(40);
805
+      watchdog_refresh();
799 806
     }
800 807
     WRITE(BEEPER_PIN, HIGH);
801 808
   #endif
@@ -820,6 +827,7 @@ void Temperature::_temp_error(const heater_id_t heater_id, PGM_P const serial_ms
820 827
   }
821 828
 
822 829
   disable_all_heaters(); // always disable (even for bogus temp)
830
+  watchdog_refresh();
823 831
 
824 832
   #if BOGUS_TEMPERATURE_GRACE_PERIOD
825 833
     const millis_t ms = millis();
@@ -923,8 +931,8 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
923 931
             }
924 932
           #endif // PID_EXTRUSION_SCALING
925 933
           #if ENABLED(PID_FAN_SCALING)
926
-            if (thermalManager.fan_speed[active_extruder] > PID_FAN_SCALING_MIN_SPEED) {
927
-              work_pid[ee].Kf = PID_PARAM(Kf, ee) + (PID_FAN_SCALING_LIN_FACTOR) * thermalManager.fan_speed[active_extruder];
934
+            if (fan_speed[active_extruder] > PID_FAN_SCALING_MIN_SPEED) {
935
+              work_pid[ee].Kf = PID_PARAM(Kf, ee) + (PID_FAN_SCALING_LIN_FACTOR) * fan_speed[active_extruder];
928 936
               pid_output += work_pid[ee].Kf;
929 937
             }
930 938
             //pid_output -= work_pid[ee].Ki;
@@ -1243,7 +1251,7 @@ void Temperature::manage_heater() {
1243 1251
               fan_chamber_pwm += (CHAMBER_FAN_FACTOR) * 2;
1244 1252
           #endif
1245 1253
           NOMORE(fan_chamber_pwm, 225);
1246
-          thermalManager.set_fan_speed(2, fan_chamber_pwm); // TODO: instead of fan 2, set to chamber fan
1254
+          set_fan_speed(2, fan_chamber_pwm); // TODO: instead of fan 2, set to chamber fan
1247 1255
         #endif
1248 1256
 
1249 1257
         #if ENABLED(CHAMBER_VENT)
@@ -1274,7 +1282,7 @@ void Temperature::manage_heater() {
1274 1282
       else if (!flag_chamber_off) {
1275 1283
         #if ENABLED(CHAMBER_FAN)
1276 1284
           flag_chamber_off = true;
1277
-          thermalManager.set_fan_speed(2, 0);
1285
+          set_fan_speed(2, 0);
1278 1286
         #endif
1279 1287
         #if ENABLED(CHAMBER_VENT)
1280 1288
           flag_chamber_excess_heat = false;
@@ -1355,7 +1363,7 @@ void Temperature::manage_heater() {
1355 1363
   user_thermistor_t Temperature::user_thermistor[USER_THERMISTORS]; // Initialized by settings.load()
1356 1364
 
1357 1365
   void Temperature::reset_user_thermistors() {
1358
-    user_thermistor_t user_thermistor[USER_THERMISTORS] = {
1366
+    user_thermistor_t default_user_thermistor[USER_THERMISTORS] = {
1359 1367
       #if HEATER_0_USER_THERMISTOR
1360 1368
         { true, 0, 0, HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS, 0, 0, HOTEND0_BETA, 0 },
1361 1369
       #endif
@@ -1387,7 +1395,7 @@ void Temperature::manage_heater() {
1387 1395
         { true, 0, 0, CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS, 0, 0, CHAMBER_BETA, 0 }
1388 1396
       #endif
1389 1397
     };
1390
-    COPY(thermalManager.user_thermistor, user_thermistor);
1398
+    COPY(user_thermistor, default_user_thermistor);
1391 1399
   }
1392 1400
 
1393 1401
   void Temperature::log_user_thermistor(const uint8_t t_index, const bool eprom/*=false*/) {
@@ -2423,7 +2431,7 @@ void Temperature::readings_ready() {
2423 2431
 
2424 2432
   #endif // HAS_HOTEND
2425 2433
 
2426
-  #if HAS_HEATED_BED
2434
+  #if ENABLED(THERMAL_PROTECTION_BED)
2427 2435
     #if TEMPDIR(BED) < 0
2428 2436
       #define BEDCMP(A,B) ((A)<(B))
2429 2437
     #else
@@ -2434,7 +2442,7 @@ void Temperature::readings_ready() {
2434 2442
     if (bed_on && BEDCMP(mintemp_raw_BED, temp_bed.raw)) min_temp_error(H_BED);
2435 2443
   #endif
2436 2444
 
2437
-  #if HAS_HEATED_CHAMBER
2445
+  #if BOTH(HAS_HEATED_CHAMBER, THERMAL_PROTECTION_CHAMBER)
2438 2446
     #if TEMPDIR(CHAMBER) < 0
2439 2447
       #define CHAMBERCMP(A,B) ((A)<(B))
2440 2448
     #else

+ 2
- 2
Marlin/src/module/temperature.h Datei anzeigen

@@ -696,7 +696,7 @@ class Temperature {
696 696
 
697 697
         static bool wait_for_chamber(const bool no_wait_for_cooling=true);
698 698
       #endif
699
-    #endif // HAS_TEMP_CHAMBER
699
+    #endif
700 700
 
701 701
     #if WATCH_CHAMBER
702 702
       static void start_watching_chamber();
@@ -715,7 +715,7 @@ class Temperature {
715 715
         ;
716 716
         start_watching_chamber();
717 717
       }
718
-    #endif // HAS_HEATED_CHAMBER
718
+    #endif
719 719
 
720 720
     /**
721 721
      * The software PWM power for a heater

Laden…
Abbrechen
Speichern