Bladeren bron

Allow lcd_setstatusPGM to reset the alert level

Scott Lahteine 7 jaren geleden
bovenliggende
commit
6f89db11f0
4 gewijzigde bestanden met toevoegingen van 23 en 26 verwijderingen
  1. 13
    17
      Marlin/G26_Mesh_Validation_Tool.cpp
  2. 1
    1
      Marlin/ubl_G29.cpp
  3. 6
    5
      Marlin/ultralcd.cpp
  4. 3
    3
      Marlin/ultralcd.h

+ 13
- 17
Marlin/G26_Mesh_Validation_Tool.cpp Bestand weergeven

@@ -131,7 +131,7 @@
131 131
   void set_destination_to_current();
132 132
   void set_current_to_destination();
133 133
   void prepare_move_to_destination();
134
-  void lcd_setstatuspgm(const char* const message, const uint8_t level);
134
+  void lcd_setstatusPGM(const char* const message, const int8_t level);
135 135
   void sync_plan_position_e();
136 136
   void chirp_at_user();
137 137
 
@@ -181,18 +181,17 @@
181 181
     safe_delay(10);                       // Wait for click to settle
182 182
 
183 183
     #if ENABLED(ULTRA_LCD)
184
-      lcd_setstatuspgm(PSTR("Mesh Validation Stopped."), 99);
184
+      lcd_setstatusPGM(PSTR("Mesh Validation Stopped."), 99);
185 185
       lcd_quick_feedback();
186 186
     #endif
187
-    lcd_reset_alert_level();
188 187
 
189 188
     while (!ubl_lcd_clicked()) idle();    // Wait for button release
190 189
 
191 190
     // If the button is suddenly pressed again,
192 191
     // ask the user to resolve the issue
193
-    lcd_setstatuspgm(PSTR("Release button"), 99); // will never appear...
192
+    lcd_setstatusPGM(PSTR("Release button"), 99); // will never appear...
194 193
     while (ubl_lcd_clicked()) idle();             // unless this loop happens
195
-    lcd_setstatuspgm(PSTR(""));
194
+    lcd_setstatusPGM(PSTR(""), -1);
196 195
 
197 196
     return true;
198 197
   }
@@ -351,8 +350,7 @@
351 350
     } while (--g26_repeats && location.x_index >= 0 && location.y_index >= 0);
352 351
 
353 352
     LEAVE:
354
-    lcd_reset_alert_level();
355
-    lcd_setstatuspgm(PSTR("Leaving G26"));
353
+    lcd_setstatusPGM(PSTR("Leaving G26"), -1);
356 354
 
357 355
     retract_filament(destination);
358 356
     destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES;
@@ -726,8 +724,7 @@
726 724
   }
727 725
 
728 726
   bool unified_bed_leveling::exit_from_g26() {
729
-    lcd_reset_alert_level();
730
-    lcd_setstatuspgm(PSTR("Leaving G26"));
727
+    lcd_setstatusPGM(PSTR("Leaving G26"), -1);
731 728
     while (ubl_lcd_clicked()) idle();
732 729
     return UBL_ERR;
733 730
   }
@@ -741,7 +738,7 @@
741 738
     #if HAS_TEMP_BED
742 739
       #if ENABLED(ULTRA_LCD)
743 740
         if (g26_bed_temp > 25) {
744
-          lcd_setstatuspgm(PSTR("G26 Heating Bed."), 99);
741
+          lcd_setstatusPGM(PSTR("G26 Heating Bed."), 99);
745 742
           lcd_quick_feedback();
746 743
       #endif
747 744
           has_control_of_lcd_panel = true;
@@ -757,7 +754,7 @@
757 754
           }
758 755
       #if ENABLED(ULTRA_LCD)
759 756
         }
760
-        lcd_setstatuspgm(PSTR("G26 Heating Nozzle."), 99);
757
+        lcd_setstatusPGM(PSTR("G26 Heating Nozzle."), 99);
761 758
         lcd_quick_feedback();
762 759
       #endif
763 760
     #endif
@@ -774,8 +771,7 @@
774 771
     }
775 772
 
776 773
     #if ENABLED(ULTRA_LCD)
777
-      lcd_reset_alert_level();
778
-      lcd_setstatuspgm(PSTR(""));
774
+      lcd_setstatusPGM(PSTR(""), -1);
779 775
       lcd_quick_feedback();
780 776
     #endif
781 777
 
@@ -792,7 +788,7 @@
792 788
 
793 789
       has_control_of_lcd_panel = true;
794 790
 
795
-      lcd_setstatuspgm(PSTR("User-Controlled Prime"), 99);
791
+      lcd_setstatusPGM(PSTR("User-Controlled Prime"), 99);
796 792
       chirp_at_user();
797 793
 
798 794
       set_destination_to_current();
@@ -819,9 +815,9 @@
819 815
       while (ubl_lcd_clicked()) idle();           // Debounce Encoder Wheel
820 816
 
821 817
       #if ENABLED(ULTRA_LCD)
822
-        strcpy_P(lcd_status_message, PSTR("Done Priming")); // We can't do lcd_setstatuspgm() without having it continue;
818
+        strcpy_P(lcd_status_message, PSTR("Done Priming")); // We can't do lcd_setstatusPGM() without having it continue;
823 819
                                                             // So...  We cheat to get a message up.
824
-        lcd_setstatuspgm(PSTR("Done Priming"), 99);
820
+        lcd_setstatusPGM(PSTR("Done Priming"), 99);
825 821
         lcd_quick_feedback();
826 822
       #endif
827 823
 
@@ -830,7 +826,7 @@
830 826
     }
831 827
     else {
832 828
       #if ENABLED(ULTRA_LCD)
833
-        lcd_setstatuspgm(PSTR("Fixed Length Prime."), 99);
829
+        lcd_setstatusPGM(PSTR("Fixed Length Prime."), 99);
834 830
         lcd_quick_feedback();
835 831
       #endif
836 832
       set_destination_to_current();

+ 1
- 1
Marlin/ubl_G29.cpp Bestand weergeven

@@ -58,7 +58,7 @@
58 58
   typedef void (*screenFunc_t)();
59 59
   extern void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0);
60 60
   extern void lcd_setstatus(const char* message, const bool persist);
61
-  extern void lcd_setstatuspgm(const char* message, const uint8_t level);
61
+  extern void lcd_setstatusPGM(const char* message, const int8_t level);
62 62
 
63 63
   int    unified_bed_leveling::g29_verbose_level,
64 64
          unified_bed_leveling::g29_phase_value,

+ 6
- 5
Marlin/ultralcd.cpp Bestand weergeven

@@ -680,7 +680,7 @@ void kill_screen(const char* lcd_msg) {
680 680
       #if ENABLED(PARK_HEAD_ON_PAUSE)
681 681
         enqueue_and_echo_commands_P(PSTR("M125"));
682 682
       #endif
683
-      lcd_setstatuspgm(PSTR(MSG_PRINT_PAUSED), true);
683
+      lcd_setstatusPGM(PSTR(MSG_PRINT_PAUSED), -1);
684 684
     }
685 685
 
686 686
     void lcd_sdcard_resume() {
@@ -690,7 +690,7 @@ void kill_screen(const char* lcd_msg) {
690 690
         card.startFileprint();
691 691
         print_job_timer.start();
692 692
       #endif
693
-      lcd_setstatuspgm(PSTR(""), true);
693
+      lcd_setstatusPGM(PSTR(""), -1);
694 694
     }
695 695
 
696 696
     void lcd_sdcard_stop() {
@@ -703,7 +703,7 @@ void kill_screen(const char* lcd_msg) {
703 703
         for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0;
704 704
       #endif
705 705
       wait_for_heatup = false;
706
-      LCD_MESSAGEPGM(MSG_PRINT_ABORTED);
706
+      lcd_setstatusPGM(PSTR(MSG_PRINT_PAUSED), -1);
707 707
     }
708 708
 
709 709
   #endif // SDSUPPORT
@@ -4095,7 +4095,8 @@ void lcd_setstatus(const char * const message, const bool persist) {
4095 4095
   lcd_finishstatus(persist);
4096 4096
 }
4097 4097
 
4098
-void lcd_setstatuspgm(const char * const message, const uint8_t level) {
4098
+void lcd_setstatusPGM(const char * const message, int8_t level) {
4099
+  if (level < 0) level = lcd_status_message_level = 0;
4099 4100
   if (level < lcd_status_message_level) return;
4100 4101
   lcd_status_message_level = level;
4101 4102
   strncpy_P(lcd_status_message, message, 3 * (LCD_WIDTH));
@@ -4113,7 +4114,7 @@ void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) {
4113 4114
 }
4114 4115
 
4115 4116
 void lcd_setalertstatuspgm(const char * const message) {
4116
-  lcd_setstatuspgm(message, 1);
4117
+  lcd_setstatusPGM(message, 1);
4117 4118
   #if ENABLED(ULTIPANEL)
4118 4119
     lcd_return_to_status();
4119 4120
   #endif

+ 3
- 3
Marlin/ultralcd.h Bestand weergeven

@@ -38,7 +38,7 @@
38 38
   void lcd_init();
39 39
   bool lcd_hasstatus();
40 40
   void lcd_setstatus(const char* message, const bool persist=false);
41
-  void lcd_setstatuspgm(const char* message, const uint8_t level=0);
41
+  void lcd_setstatusPGM(const char* message, const int8_t level=0);
42 42
   void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...);
43 43
   void lcd_setalertstatuspgm(const char* message);
44 44
   void lcd_reset_alert_level();
@@ -61,7 +61,7 @@
61 61
     void bootscreen();
62 62
   #endif
63 63
 
64
-  #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
64
+  #define LCD_MESSAGEPGM(x) lcd_setstatusPGM(PSTR(x))
65 65
   #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
66 66
 
67 67
   #define LCD_UPDATE_INTERVAL 100
@@ -153,7 +153,7 @@
153 153
   inline void lcd_init() {}
154 154
   inline bool lcd_hasstatus() { return false; }
155 155
   inline void lcd_setstatus(const char* const message, const bool persist=false) { UNUSED(message); UNUSED(persist); }
156
-  inline void lcd_setstatuspgm(const char* const message, const uint8_t level=0) { UNUSED(message); UNUSED(level); }
156
+  inline void lcd_setstatusPGM(const char* const message, const int8_t level=0) { UNUSED(message); UNUSED(level); }
157 157
   inline void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) { UNUSED(level); UNUSED(fmt); }
158 158
   inline void lcd_buttons_update() {}
159 159
   inline void lcd_reset_alert_level() {}

Laden…
Annuleren
Opslaan