Browse Source

LIGHTWEIGHT_UI: Allow feedrate % to exceed 255% (#11656)

- Changed type of integer used for feedrate percentage from uint8_t to uint16_t.
Marcio Teixeira 7 years ago
parent
commit
0f14977b5d

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

601
   write_str(str, 6);
601
   write_str(str, 6);
602
 }
602
 }
603
 
603
 
604
-void ST7920_Lite_Status_Screen::draw_feedrate_percentage(const uint8_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 EXTRUDERS == 1
709
   // because the actual temps fluctuate so by updating
709
   // because the actual temps fluctuate so by updating
710
   // them only during blinks we gain a bit of stability.
710
   // them only during blinks we gain a bit of stability.
711
   const bool       blink             = lcd_blink();
711
   const bool       blink             = lcd_blink();
712
-  const uint8_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 EXTRUDERS == 2
736
   if (forceUpdate || indicators_changed()) {
736
   if (forceUpdate || indicators_changed()) {
737
     const bool       blink             = lcd_blink();
737
     const bool       blink             = lcd_blink();
738
     const duration_t elapsed           = print_job_timer.duration();
738
     const duration_t elapsed           = print_job_timer.duration();
739
-    const uint8_t    feedrate_perc     = feedrate_percentage;
739
+    const uint16_t   feedrate_perc     = feedrate_percentage;
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);

+ 1
- 1
Marlin/src/lcd/dogm/status_screen_lite_ST7920_class.h View File

87
     static void draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate = false);
87
     static void draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate = false);
88
     static void draw_fan_speed(const uint8_t value);
88
     static void draw_fan_speed(const uint8_t value);
89
     static void draw_print_time(const duration_t &elapsed);
89
     static void draw_print_time(const duration_t &elapsed);
90
-    static void draw_feedrate_percentage(const uint8_t percentage);
90
+    static void draw_feedrate_percentage(const uint16_t percentage);
91
     static void draw_status_message(const char *str);
91
     static void draw_status_message(const char *str);
92
     static void draw_position(const float x, const float y, const float z, bool position_known = true);
92
     static void draw_position(const float x, const float y, const float z, bool position_known = true);
93
 
93
 

Loading…
Cancel
Save