Browse Source

Fix lightweight UI hotends display

Scott Lahteine 6 years ago
parent
commit
517b4f4cd4
1 changed files with 11 additions and 11 deletions
  1. 11
    11
      Marlin/src/lcd/dogm/status_screen_lite_ST7920.h

+ 11
- 11
Marlin/src/lcd/dogm/status_screen_lite_ST7920.h View File

419
 
419
 
420
   // Draw the static icons in GDRAM
420
   // Draw the static icons in GDRAM
421
   draw_gdram_icon(1, 1, nozzle_icon);
421
   draw_gdram_icon(1, 1, nozzle_icon);
422
-  #if EXTRUDERS == 2
422
+  #if HOTENDS > 1
423
     draw_gdram_icon(1,2,nozzle_icon);
423
     draw_gdram_icon(1,2,nozzle_icon);
424
     draw_gdram_icon(1,3,bed_icon);
424
     draw_gdram_icon(1,3,bed_icon);
425
   #else
425
   #else
440
  * text data (the percentage).
440
  * text data (the percentage).
441
  */
441
  */
442
 void ST7920_Lite_Status_Screen::draw_progress_bar(const uint8_t value) {
442
 void ST7920_Lite_Status_Screen::draw_progress_bar(const uint8_t value) {
443
-  #if EXTRUDERS == 1
443
+  #if HOTENDS == 1
444
     // If we have only one extruder, draw a long progress bar on the third line
444
     // If we have only one extruder, draw a long progress bar on the third line
445
     const uint8_t top     = 1,         // Top in pixels
445
     const uint8_t top     = 1,         // Top in pixels
446
                   bottom  = 13,        // Bottom in pixels
446
                   bottom  = 13,        // Bottom in pixels
477
   }
477
   }
478
 
478
 
479
   // Draw the percentage as text in DDRAM
479
   // Draw the percentage as text in DDRAM
480
-  #if EXTRUDERS == 1
480
+  #if HOTENDS == 1
481
     set_ddram_address(DDRAM_LINE_3 + 4);
481
     set_ddram_address(DDRAM_LINE_3 + 4);
482
     begin_data();
482
     begin_data();
483
     write_byte(' ');
483
     write_byte(' ');
505
 
505
 
506
 void ST7920_Lite_Status_Screen::draw_heat_icon(const bool whichIcon, const bool heating) {
506
 void ST7920_Lite_Status_Screen::draw_heat_icon(const bool whichIcon, const bool heating) {
507
   set_ddram_address(
507
   set_ddram_address(
508
-    #if EXTRUDERS == 1
508
+    #if HOTENDS == 1
509
       DDRAM_LINE_2
509
       DDRAM_LINE_2
510
     #else
510
     #else
511
       DDRAM_LINE_3
511
       DDRAM_LINE_3
573
   void ST7920_Lite_Status_Screen::draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate) {
573
   void ST7920_Lite_Status_Screen::draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate) {
574
     const bool show_target = target && FAR(temp, target);
574
     const bool show_target = target && FAR(temp, target);
575
     draw_temps(2
575
     draw_temps(2
576
-      #if EXTRUDERS > 1
576
+      #if HOTENDS > 1
577
         + 1
577
         + 1
578
       #endif
578
       #endif
579
       , temp, target, show_target, display_state.bed_show_target != show_target || forceUpdate
579
       , temp, target, show_target, display_state.bed_show_target != show_target || forceUpdate
590
 }
590
 }
591
 
591
 
592
 void ST7920_Lite_Status_Screen::draw_print_time(const duration_t &elapsed) {
592
 void ST7920_Lite_Status_Screen::draw_print_time(const duration_t &elapsed) {
593
-  #if EXTRUDERS == 1
593
+  #if HOTENDS == 1
594
     set_ddram_address(DDRAM_LINE_3);
594
     set_ddram_address(DDRAM_LINE_3);
595
   #else
595
   #else
596
     set_ddram_address(DDRAM_LINE_3 + 5);
596
     set_ddram_address(DDRAM_LINE_3 + 5);
604
 void ST7920_Lite_Status_Screen::draw_feedrate_percentage(const uint16_t percentage) {
604
 void ST7920_Lite_Status_Screen::draw_feedrate_percentage(const uint16_t percentage) {
605
   // We only have enough room for the feedrate when
605
   // We only have enough room for the feedrate when
606
   // we have one extruder
606
   // we have one extruder
607
-  #if EXTRUDERS == 1
607
+  #if HOTENDS == 1
608
     set_ddram_address(DDRAM_LINE_2 + 6);
608
     set_ddram_address(DDRAM_LINE_2 + 6);
609
     begin_data();
609
     begin_data();
610
     write_number(percentage, 3);
610
     write_number(percentage, 3);
712
   const uint16_t   feedrate_perc     = feedrate_percentage;
712
   const uint16_t   feedrate_perc     = feedrate_percentage;
713
   const uint8_t    fan_speed         = ((fanSpeeds[0] + 1) * 100) / 256;
713
   const uint8_t    fan_speed         = ((fanSpeeds[0] + 1) * 100) / 256;
714
   const int16_t    extruder_1_target = thermalManager.degTargetHotend(0);
714
   const int16_t    extruder_1_target = thermalManager.degTargetHotend(0);
715
-  #if EXTRUDERS == 2
715
+  #if HOTENDS > 1
716
     const int16_t  extruder_2_target = thermalManager.degTargetHotend(1);
716
     const int16_t  extruder_2_target = thermalManager.degTargetHotend(1);
717
   #endif
717
   #endif
718
   #if HAS_HEATED_BED
718
   #if HAS_HEATED_BED
720
   #endif
720
   #endif
721
   static uint16_t last_checksum = 0;
721
   static uint16_t last_checksum = 0;
722
   const uint16_t checksum = blink ^ feedrate_perc ^ fan_speed ^ extruder_1_target
722
   const uint16_t checksum = blink ^ feedrate_perc ^ fan_speed ^ extruder_1_target
723
-    #if EXTRUDERS == 2
723
+    #if HOTENDS > 1
724
       ^ extruder_2_target
724
       ^ extruder_2_target
725
     #endif
725
     #endif
726
     #if HAS_HEATED_BED
726
     #if HAS_HEATED_BED
740
     const uint8_t    fan_speed         = ((fanSpeeds[0] + 1) * 100) / 256;
740
     const uint8_t    fan_speed         = ((fanSpeeds[0] + 1) * 100) / 256;
741
     const int16_t    extruder_1_temp   = thermalManager.degHotend(0),
741
     const int16_t    extruder_1_temp   = thermalManager.degHotend(0),
742
                      extruder_1_target = thermalManager.degTargetHotend(0);
742
                      extruder_1_target = thermalManager.degTargetHotend(0);
743
-    #if EXTRUDERS == 2
743
+    #if HOTENDS > 1
744
       const int16_t  extruder_2_temp   = thermalManager.degHotend(1),
744
       const int16_t  extruder_2_temp   = thermalManager.degHotend(1),
745
                      extruder_2_target = thermalManager.degTargetHotend(1);
745
                      extruder_2_target = thermalManager.degTargetHotend(1);
746
     #endif
746
     #endif
750
     #endif
750
     #endif
751
 
751
 
752
     draw_extruder_1_temp(extruder_1_temp, extruder_1_target, forceUpdate);
752
     draw_extruder_1_temp(extruder_1_temp, extruder_1_target, forceUpdate);
753
-    #if EXTRUDERS == 2
753
+    #if HOTENDS > 1
754
       draw_extruder_2_temp(extruder_2_temp, extruder_2_target, forceUpdate);
754
       draw_extruder_2_temp(extruder_2_temp, extruder_2_target, forceUpdate);
755
     #endif
755
     #endif
756
     #if HAS_HEATED_BED
756
     #if HAS_HEATED_BED

Loading…
Cancel
Save