Ver código fonte

heater_ind_t => heater_id_t

Scott Lahteine 3 anos atrás
pai
commit
49ca16c3fb

+ 1
- 1
Marlin/src/gcode/temp/M303.cpp Ver arquivo

@@ -62,7 +62,7 @@ void GcodeSuite::M303() {
62 62
 
63 63
   #define SI TERN(PIDTEMPBED, H_BED, H_E0)
64 64
   #define EI TERN(PIDTEMP, HOTENDS - 1, H_BED)
65
-  const heater_ind_t e = (heater_ind_t)parser.intval('E');
65
+  const heater_id_t e = (heater_id_t)parser.intval('E');
66 66
   if (!WITHIN(e, SI, EI)) {
67 67
     SERIAL_ECHOLNPGM(STR_PID_BAD_EXTRUDER_NUM);
68 68
     TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_EXTRUDER_NUM));

+ 7
- 7
Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp Ver arquivo

@@ -519,13 +519,13 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
519 519
   }
520 520
 }
521 521
 
522
-FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const char prefix, const bool blink) {
522
+FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char prefix, const bool blink) {
523 523
   #if HAS_HEATED_BED
524
-    const bool isBed = heater < 0;
525
-    const float t1 = (isBed ? thermalManager.degBed()       : thermalManager.degHotend(heater)),
526
-                t2 = (isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater));
524
+    const bool isBed = heater_id < 0;
525
+    const float t1 = (isBed ? thermalManager.degBed()       : thermalManager.degHotend(heater_id)),
526
+                t2 = (isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater_id));
527 527
   #else
528
-    const float t1 = thermalManager.degHotend(heater), t2 = thermalManager.degTargetHotend(heater);
528
+    const float t1 = thermalManager.degHotend(heater_id), t2 = thermalManager.degTargetHotend(heater_id);
529 529
   #endif
530 530
 
531 531
   if (prefix >= 0) lcd_put_wchar(prefix);
@@ -540,7 +540,7 @@ FORCE_INLINE void _draw_heater_status(const heater_ind_t heater, const char pref
540 540
       #if HAS_HEATED_BED
541 541
         isBed ? thermalManager.bed_idle.timed_out :
542 542
       #endif
543
-      thermalManager.hotend_idle[heater].timed_out
543
+      thermalManager.hotend_idle[heater_id].timed_out
544 544
     );
545 545
 
546 546
     if (!blink && is_idle) {
@@ -990,7 +990,7 @@ void MarlinUI::draw_status_screen() {
990 990
     void MarlinUI::draw_hotend_status(const uint8_t row, const uint8_t extruder) {
991 991
       if (row < LCD_HEIGHT) {
992 992
         lcd_moveto(LCD_WIDTH - 9, row);
993
-        _draw_heater_status((heater_ind_t)extruder, LCD_STR_THERMOMETER[0], get_blink());
993
+        _draw_heater_status((heater_id_t)extruder, LCD_STR_THERMOMETER[0], get_blink());
994 994
       }
995 995
     }
996 996
 

+ 12
- 12
Marlin/src/lcd/dogm/status_screen_DOGM.cpp Ver arquivo

@@ -178,17 +178,17 @@ FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, cons
178 178
 #if DO_DRAW_HOTENDS
179 179
 
180 180
   // Draw hotend bitmap with current and target temperatures
181
-  FORCE_INLINE void _draw_hotend_status(const heater_ind_t heater, const bool blink) {
181
+  FORCE_INLINE void _draw_hotend_status(const heater_id_t heater_id, const bool blink) {
182 182
     #if !HEATER_IDLE_HANDLER
183 183
       UNUSED(blink);
184 184
     #endif
185 185
 
186
-    const bool isHeat = HOTEND_ALT(heater);
186
+    const bool isHeat = HOTEND_ALT(heater_id);
187 187
 
188
-    const uint8_t tx = STATUS_HOTEND_TEXT_X(heater);
188
+    const uint8_t tx = STATUS_HOTEND_TEXT_X(heater_id);
189 189
 
190
-    const float temp = thermalManager.degHotend(heater),
191
-              target = thermalManager.degTargetHotend(heater);
190
+    const float temp = thermalManager.degHotend(heater_id),
191
+              target = thermalManager.degTargetHotend(heater_id);
192 192
 
193 193
     #if DISABLED(STATUS_HOTEND_ANIM)
194 194
       #define STATIC_HOTEND true
@@ -237,24 +237,24 @@ FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, cons
237 237
 
238 238
       #if ANIM_HOTEND
239 239
         // Draw hotend bitmap, either whole or split by the heating percent
240
-        const uint8_t hx = STATUS_HOTEND_X(heater),
241
-                      bw = STATUS_HOTEND_BYTEWIDTH(heater);
240
+        const uint8_t hx = STATUS_HOTEND_X(heater_id),
241
+                      bw = STATUS_HOTEND_BYTEWIDTH(heater_id);
242 242
         #if ENABLED(STATUS_HEAT_PERCENT)
243 243
           if (isHeat && tall <= BAR_TALL) {
244 244
             const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall;
245
-            u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, ph, HOTEND_BITMAP(heater, false));
246
-            u8g.drawBitmapP(hx, STATUS_HEATERS_Y + ph, bw, tall + 1, HOTEND_BITMAP(heater, true) + ph * bw);
245
+            u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, ph, HOTEND_BITMAP(heater_id, false));
246
+            u8g.drawBitmapP(hx, STATUS_HEATERS_Y + ph, bw, tall + 1, HOTEND_BITMAP(heater_id, true) + ph * bw);
247 247
           }
248 248
           else
249 249
         #endif
250
-            u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, STATUS_HEATERS_HEIGHT, HOTEND_BITMAP(heater, isHeat));
250
+            u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, STATUS_HEATERS_HEIGHT, HOTEND_BITMAP(heater_id, isHeat));
251 251
       #endif
252 252
 
253 253
     } // PAGE_CONTAINS
254 254
 
255 255
     if (PAGE_UNDER(7)) {
256 256
       #if HEATER_IDLE_HANDLER
257
-        const bool dodraw = (blink || !thermalManager.hotend_idle[heater].timed_out);
257
+        const bool dodraw = (blink || !thermalManager.hotend_idle[heater_id].timed_out);
258 258
       #else
259 259
         constexpr bool dodraw = true;
260 260
       #endif
@@ -597,7 +597,7 @@ void MarlinUI::draw_status_screen() {
597 597
     // Extruders
598 598
     #if DO_DRAW_HOTENDS
599 599
       LOOP_L_N(e, MAX_HOTEND_DRAW)
600
-        _draw_hotend_status((heater_ind_t)e, blink);
600
+        _draw_hotend_status((heater_id_t)e, blink);
601 601
     #endif
602 602
 
603 603
     // Laser / Spindle

+ 1
- 1
Marlin/src/lcd/extui/ui_api.cpp Ver arquivo

@@ -868,7 +868,7 @@ namespace ExtUI {
868 868
     }
869 869
 
870 870
     void startPIDTune(const float temp, extruder_t tool) {
871
-      thermalManager.PID_autotune(temp, (heater_ind_t)tool, 8, true);
871
+      thermalManager.PID_autotune(temp, (heater_id_t)tool, 8, true);
872 872
     }
873 873
   #endif
874 874
 

+ 36
- 36
Marlin/src/module/temperature.cpp Ver arquivo

@@ -377,7 +377,7 @@ volatile bool Temperature::raw_temps_ready = false;
377 377
    * Needs sufficient heater power to make some overshoot at target
378 378
    * temperature to succeed.
379 379
    */
380
-  void Temperature::PID_autotune(const float &target, const heater_ind_t heater, const int8_t ncycles, const bool set_result/*=false*/) {
380
+  void Temperature::PID_autotune(const float &target, const heater_id_t heater_id, const int8_t ncycles, const bool set_result/*=false*/) {
381 381
     float current_temp = 0.0;
382 382
     int cycles = 0;
383 383
     bool heating = true;
@@ -389,11 +389,11 @@ volatile bool Temperature::raw_temps_ready = false;
389 389
     PID_t tune_pid = { 0, 0, 0 };
390 390
     float maxT = 0, minT = 10000;
391 391
 
392
-    const bool isbed = (heater == H_BED);
392
+    const bool isbed = (heater_id == H_BED);
393 393
 
394 394
     #if HAS_PID_FOR_BOTH
395 395
       #define GHV(B,H) (isbed ? (B) : (H))
396
-      #define SHV(B,H) do{ if (isbed) temp_bed.soft_pwm_amount = B; else temp_hotend[heater].soft_pwm_amount = H; }while(0)
396
+      #define SHV(B,H) do{ if (isbed) temp_bed.soft_pwm_amount = B; else temp_hotend[heater_id].soft_pwm_amount = H; }while(0)
397 397
       #define ONHEATINGSTART() (isbed ? printerEventLEDs.onBedHeatingStart() : printerEventLEDs.onHotendHeatingStart())
398 398
       #define ONHEATING(S,C,T) (isbed ? printerEventLEDs.onBedHeating(S,C,T) : printerEventLEDs.onHotendHeating(S,C,T))
399 399
     #elif ENABLED(PIDTEMPBED)
@@ -403,7 +403,7 @@ volatile bool Temperature::raw_temps_ready = false;
403 403
       #define ONHEATING(S,C,T) printerEventLEDs.onBedHeating(S,C,T)
404 404
     #else
405 405
       #define GHV(B,H) H
406
-      #define SHV(B,H) (temp_hotend[heater].soft_pwm_amount = H)
406
+      #define SHV(B,H) (temp_hotend[heater_id].soft_pwm_amount = H)
407 407
       #define ONHEATINGSTART() printerEventLEDs.onHotendHeatingStart()
408 408
       #define ONHEATING(S,C,T) printerEventLEDs.onHotendHeating(S,C,T)
409 409
     #endif
@@ -427,7 +427,7 @@ volatile bool Temperature::raw_temps_ready = false;
427 427
 
428 428
     TERN_(HAS_AUTO_FAN, next_auto_fan_check_ms = next_temp_ms + 2500UL);
429 429
 
430
-    if (target > GHV(BED_MAX_TARGET, temp_range[heater].maxtemp - HOTEND_OVERSHOOT)) {
430
+    if (target > GHV(BED_MAX_TARGET, temp_range[heater_id].maxtemp - HOTEND_OVERSHOOT)) {
431 431
       SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH);
432 432
       TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH));
433 433
       return;
@@ -441,7 +441,7 @@ volatile bool Temperature::raw_temps_ready = false;
441 441
     SHV(bias = d = (MAX_BED_POWER) >> 1, bias = d = (PID_MAX) >> 1);
442 442
 
443 443
     #if ENABLED(PRINTER_EVENT_LEDS)
444
-      const float start_temp = GHV(temp_bed.celsius, temp_hotend[heater].celsius);
444
+      const float start_temp = GHV(temp_bed.celsius, temp_hotend[heater_id].celsius);
445 445
       LEDColor color = ONHEATINGSTART();
446 446
     #endif
447 447
 
@@ -457,7 +457,7 @@ volatile bool Temperature::raw_temps_ready = false;
457 457
         updateTemperaturesFromRawValues();
458 458
 
459 459
         // Get the current temperature and constrain it
460
-        current_temp = GHV(temp_bed.celsius, temp_hotend[heater].celsius);
460
+        current_temp = GHV(temp_bed.celsius, temp_hotend[heater_id].celsius);
461 461
         NOLESS(maxT, current_temp);
462 462
         NOMORE(minT, current_temp);
463 463
 
@@ -549,7 +549,7 @@ volatile bool Temperature::raw_temps_ready = false;
549 549
       // Report heater states every 2 seconds
550 550
       if (ELAPSED(ms, next_temp_ms)) {
551 551
         #if HAS_TEMP_SENSOR
552
-          print_heater_states(isbed ? active_extruder : heater);
552
+          print_heater_states(isbed ? active_extruder : heater_id);
553 553
           SERIAL_EOL();
554 554
         #endif
555 555
         next_temp_ms = ms + 2000UL;
@@ -564,10 +564,10 @@ volatile bool Temperature::raw_temps_ready = false;
564 564
                 if (current_temp > watch_temp_target) heated = true;  // - Flag if target temperature reached
565 565
               }
566 566
               else if (ELAPSED(ms, temp_change_ms))                   // Watch timer expired
567
-                _temp_error(heater, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD));
567
+                _temp_error(heater_id, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD));
568 568
             }
569 569
             else if (current_temp < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far?
570
-              _temp_error(heater, str_t_thermal_runaway, GET_TEXT(MSG_THERMAL_RUNAWAY));
570
+              _temp_error(heater_id, str_t_thermal_runaway, GET_TEXT(MSG_THERMAL_RUNAWAY));
571 571
           }
572 572
         #endif
573 573
       } // every 2 seconds
@@ -608,9 +608,9 @@ volatile bool Temperature::raw_temps_ready = false;
608 608
         }while(0)
609 609
 
610 610
         #define _SET_EXTRUDER_PID() do { \
611
-          PID_PARAM(Kp, heater) = tune_pid.Kp; \
612
-          PID_PARAM(Ki, heater) = scalePID_i(tune_pid.Ki); \
613
-          PID_PARAM(Kd, heater) = scalePID_d(tune_pid.Kd); \
611
+          PID_PARAM(Kp, heater_id) = tune_pid.Kp; \
612
+          PID_PARAM(Ki, heater_id) = scalePID_i(tune_pid.Ki); \
613
+          PID_PARAM(Kd, heater_id) = scalePID_d(tune_pid.Kd); \
614 614
           updatePID(); }while(0)
615 615
 
616 616
         // Use the result? (As with "M303 U1")
@@ -651,7 +651,7 @@ volatile bool Temperature::raw_temps_ready = false;
651 651
  * Class and Instance Methods
652 652
  */
653 653
 
654
-int16_t Temperature::getHeaterPower(const heater_ind_t heater_id) {
654
+int16_t Temperature::getHeaterPower(const heater_id_t heater_id) {
655 655
   switch (heater_id) {
656 656
     #if HAS_HEATED_BED
657 657
       case H_BED: return temp_bed.soft_pwm_amount;
@@ -758,7 +758,7 @@ int16_t Temperature::getHeaterPower(const heater_ind_t heater_id) {
758 758
 // Temperature Error Handlers
759 759
 //
760 760
 
761
-inline void loud_kill(PGM_P const lcd_msg, const heater_ind_t heater) {
761
+inline void loud_kill(PGM_P const lcd_msg, const heater_id_t heater_id) {
762 762
   marlin_state = MF_KILLED;
763 763
   #if USE_BEEPER
764 764
     for (uint8_t i = 20; i--;) {
@@ -767,10 +767,10 @@ inline void loud_kill(PGM_P const lcd_msg, const heater_ind_t heater) {
767 767
     }
768 768
     WRITE(BEEPER_PIN, HIGH);
769 769
   #endif
770
-  kill(lcd_msg, HEATER_PSTR(heater));
770
+  kill(lcd_msg, HEATER_PSTR(heater_id));
771 771
 }
772 772
 
773
-void Temperature::_temp_error(const heater_ind_t heater, PGM_P const serial_msg, PGM_P const lcd_msg) {
773
+void Temperature::_temp_error(const heater_id_t heater_id, PGM_P const serial_msg, PGM_P const lcd_msg) {
774 774
 
775 775
   static uint8_t killed = 0;
776 776
 
@@ -778,9 +778,9 @@ void Temperature::_temp_error(const heater_ind_t heater, PGM_P const serial_msg,
778 778
     SERIAL_ERROR_START();
779 779
     serialprintPGM(serial_msg);
780 780
     SERIAL_ECHOPGM(STR_STOPPED_HEATER);
781
-    if (heater >= 0)
782
-      SERIAL_ECHO((int)heater);
783
-    else if (TERN0(HAS_HEATED_CHAMBER, heater == H_CHAMBER))
781
+    if (heater_id >= 0)
782
+      SERIAL_ECHO((int)heater_id);
783
+    else if (TERN0(HAS_HEATED_CHAMBER, heater_id == H_CHAMBER))
784 784
       SERIAL_ECHOPGM(STR_HEATER_CHAMBER);
785 785
     else
786 786
       SERIAL_ECHOPGM(STR_HEATER_BED);
@@ -801,25 +801,25 @@ void Temperature::_temp_error(const heater_ind_t heater, PGM_P const serial_msg,
801 801
         if (ELAPSED(ms, expire_ms)) ++killed;
802 802
         break;
803 803
       case 2:
804
-        loud_kill(lcd_msg, heater);
804
+        loud_kill(lcd_msg, heater_id);
805 805
         ++killed;
806 806
         break;
807 807
     }
808 808
   #elif defined(BOGUS_TEMPERATURE_GRACE_PERIOD)
809 809
     UNUSED(killed);
810 810
   #else
811
-    if (!killed) { killed = 1; loud_kill(lcd_msg, heater); }
811
+    if (!killed) { killed = 1; loud_kill(lcd_msg, heater_id); }
812 812
   #endif
813 813
 }
814 814
 
815
-void Temperature::max_temp_error(const heater_ind_t heater) {
815
+void Temperature::max_temp_error(const heater_id_t heater_id) {
816 816
   TERN_(DWIN_CREALITY_LCD, Popup_Window_Temperature(1));
817
-  _temp_error(heater, PSTR(STR_T_MAXTEMP), GET_TEXT(MSG_ERR_MAXTEMP));
817
+  _temp_error(heater_id, PSTR(STR_T_MAXTEMP), GET_TEXT(MSG_ERR_MAXTEMP));
818 818
 }
819 819
 
820
-void Temperature::min_temp_error(const heater_ind_t heater) {
820
+void Temperature::min_temp_error(const heater_id_t heater_id) {
821 821
   TERN_(DWIN_CREALITY_LCD, Popup_Window_Temperature(0));
822
-  _temp_error(heater, PSTR(STR_T_MINTEMP), GET_TEXT(MSG_ERR_MINTEMP));
822
+  _temp_error(heater_id, PSTR(STR_T_MINTEMP), GET_TEXT(MSG_ERR_MINTEMP));
823 823
 }
824 824
 
825 825
 #if HAS_HOTEND
@@ -1041,14 +1041,14 @@ void Temperature::manage_heater() {
1041 1041
     HOTEND_LOOP() {
1042 1042
       #if ENABLED(THERMAL_PROTECTION_HOTENDS)
1043 1043
         if (degHotend(e) > temp_range[e].maxtemp)
1044
-          _temp_error((heater_ind_t)e, str_t_thermal_runaway, GET_TEXT(MSG_THERMAL_RUNAWAY));
1044
+          _temp_error((heater_id_t)e, str_t_thermal_runaway, GET_TEXT(MSG_THERMAL_RUNAWAY));
1045 1045
       #endif
1046 1046
 
1047 1047
       TERN_(HEATER_IDLE_HANDLER, hotend_idle[e].update(ms));
1048 1048
 
1049 1049
       #if ENABLED(THERMAL_PROTECTION_HOTENDS)
1050 1050
         // Check for thermal runaway
1051
-        thermal_runaway_protection(tr_state_machine[e], temp_hotend[e].celsius, temp_hotend[e].target, (heater_ind_t)e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS);
1051
+        thermal_runaway_protection(tr_state_machine[e], temp_hotend[e].celsius, temp_hotend[e].target, (heater_id_t)e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS);
1052 1052
       #endif
1053 1053
 
1054 1054
       temp_hotend[e].soft_pwm_amount = (temp_hotend[e].celsius > temp_range[e].mintemp || is_preheating(e)) && temp_hotend[e].celsius < temp_range[e].maxtemp ? (int)get_pid_output_hotend(e) >> 1 : 0;
@@ -1058,7 +1058,7 @@ void Temperature::manage_heater() {
1058 1058
         if (watch_hotend[e].next_ms && ELAPSED(ms, watch_hotend[e].next_ms)) {  // Time to check this extruder?
1059 1059
           if (degHotend(e) < watch_hotend[e].target) {                          // Failed to increase enough?
1060 1060
             TERN_(DWIN_CREALITY_LCD, Popup_Window_Temperature(0));
1061
-            _temp_error((heater_ind_t)e, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD));
1061
+            _temp_error((heater_id_t)e, str_t_heating_failed, GET_TEXT(MSG_HEATING_FAILED_LCD));
1062 1062
           }
1063 1063
           else                                                                  // Start again if the target is still far off
1064 1064
             start_watching_hotend(e);
@@ -1945,7 +1945,7 @@ void Temperature::init() {
1945 1945
     Temperature::tr_state_machine_t Temperature::tr_state_machine_chamber; // = { TRInactive, 0 };
1946 1946
   #endif
1947 1947
 
1948
-  void Temperature::thermal_runaway_protection(Temperature::tr_state_machine_t &sm, const float &current, const float &target, const heater_ind_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc) {
1948
+  void Temperature::thermal_runaway_protection(Temperature::tr_state_machine_t &sm, const float &current, const float &target, const heater_id_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc) {
1949 1949
 
1950 1950
     static float tr_target_temperature[HOTENDS + 1] = { 0.0 };
1951 1951
 
@@ -2311,12 +2311,12 @@ void Temperature::readings_ready() {
2311 2311
         const bool heater_on = (temp_hotend[e].target > 0
2312 2312
           || TERN0(PIDTEMP, temp_hotend[e].soft_pwm_amount) > 0
2313 2313
         );
2314
-        if (rawtemp > temp_range[e].raw_max * tdir) max_temp_error((heater_ind_t)e);
2314
+        if (rawtemp > temp_range[e].raw_max * tdir) max_temp_error((heater_id_t)e);
2315 2315
         if (heater_on && rawtemp < temp_range[e].raw_min * tdir && !is_preheating(e)) {
2316 2316
           #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED
2317 2317
             if (++consecutive_low_temperature_error[e] >= MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED)
2318 2318
           #endif
2319
-              min_temp_error((heater_ind_t)e);
2319
+              min_temp_error((heater_id_t)e);
2320 2320
         }
2321 2321
         #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED
2322 2322
           else
@@ -2883,7 +2883,7 @@ void Temperature::tick() {
2883 2883
     #if ENABLED(SHOW_TEMP_ADC_VALUES)
2884 2884
       , const float r
2885 2885
     #endif
2886
-    , const heater_ind_t e=INDEX_NONE
2886
+    , const heater_id_t e=INDEX_NONE
2887 2887
   ) {
2888 2888
     char k;
2889 2889
     switch (e) {
@@ -2974,10 +2974,10 @@ void Temperature::tick() {
2974 2974
         #if ENABLED(SHOW_TEMP_ADC_VALUES)
2975 2975
           , rawHotendTemp(e)
2976 2976
         #endif
2977
-        , (heater_ind_t)e
2977
+        , (heater_id_t)e
2978 2978
       );
2979 2979
     #endif
2980
-    SERIAL_ECHOPAIR(" @:", getHeaterPower((heater_ind_t)target_extruder));
2980
+    SERIAL_ECHOPAIR(" @:", getHeaterPower((heater_id_t)target_extruder));
2981 2981
     #if HAS_HEATED_BED
2982 2982
       SERIAL_ECHOPAIR(" B@:", getHeaterPower(H_BED));
2983 2983
     #endif
@@ -2988,7 +2988,7 @@ void Temperature::tick() {
2988 2988
       HOTEND_LOOP() {
2989 2989
         SERIAL_ECHOPAIR(" @", e);
2990 2990
         SERIAL_CHAR(':');
2991
-        SERIAL_ECHO(getHeaterPower((heater_ind_t)e));
2991
+        SERIAL_ECHO(getHeaterPower((heater_id_t)e));
2992 2992
       }
2993 2993
     #endif
2994 2994
   }

+ 7
- 7
Marlin/src/module/temperature.h Ver arquivo

@@ -45,7 +45,7 @@ typedef enum : int8_t {
45 45
   INDEX_NONE = -5,
46 46
   H_PROBE, H_REDUNDANT, H_CHAMBER, H_BED,
47 47
   H_E0, H_E1, H_E2, H_E3, H_E4, H_E5, H_E6, H_E7
48
-} heater_ind_t;
48
+} heater_id_t;
49 49
 
50 50
 // PID storage
51 51
 typedef struct { float Kp, Ki, Kd;     } PID_t;
@@ -701,7 +701,7 @@ class Temperature {
701 701
     /**
702 702
      * The software PWM power for a heater
703 703
      */
704
-    static int16_t getHeaterPower(const heater_ind_t heater);
704
+    static int16_t getHeaterPower(const heater_id_t heater_id);
705 705
 
706 706
     /**
707 707
      * Switch off all heaters, set all target temperatures to 0
@@ -720,7 +720,7 @@ class Temperature {
720 720
      * Perform auto-tuning for hotend or bed in response to M303
721 721
      */
722 722
     #if HAS_PID_HEATING
723
-      static void PID_autotune(const float &target, const heater_ind_t hotend, const int8_t ncycles, const bool set_result=false);
723
+      static void PID_autotune(const float &target, const heater_id_t heater_id, const int8_t ncycles, const bool set_result=false);
724 724
 
725 725
       #if ENABLED(NO_FAN_SLOWING_IN_PID_TUNING)
726 726
         static bool adaptive_fan_slowing;
@@ -811,9 +811,9 @@ class Temperature {
811 811
 
812 812
     TERN_(HAS_HEATED_CHAMBER, static float get_pid_output_chamber());
813 813
 
814
-    static void _temp_error(const heater_ind_t e, PGM_P const serial_msg, PGM_P const lcd_msg);
815
-    static void min_temp_error(const heater_ind_t e);
816
-    static void max_temp_error(const heater_ind_t e);
814
+    static void _temp_error(const heater_id_t e, PGM_P const serial_msg, PGM_P const lcd_msg);
815
+    static void min_temp_error(const heater_id_t e);
816
+    static void max_temp_error(const heater_id_t e);
817 817
 
818 818
     #define HAS_THERMAL_PROTECTION (EITHER(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_CHAMBER) || HAS_THERMALLY_PROTECTED_BED)
819 819
 
@@ -830,7 +830,7 @@ class Temperature {
830 830
       TERN_(HAS_THERMALLY_PROTECTED_BED, static tr_state_machine_t tr_state_machine_bed);
831 831
       TERN_(THERMAL_PROTECTION_CHAMBER, static tr_state_machine_t tr_state_machine_chamber);
832 832
 
833
-      static void thermal_runaway_protection(tr_state_machine_t &state, const float &current, const float &target, const heater_ind_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc);
833
+      static void thermal_runaway_protection(tr_state_machine_t &state, const float &current, const float &target, const heater_id_t heater_id, const uint16_t period_seconds, const uint16_t hysteresis_degc);
834 834
 
835 835
     #endif // HAS_THERMAL_PROTECTION
836 836
 };

Carregando…
Cancelar
Salvar