Browse Source

Apply const to LCD arguments and locals

Scott Lahteine 7 years ago
parent
commit
71842b6a17
5 changed files with 56 additions and 56 deletions
  1. 5
    5
      Marlin/ultralcd.cpp
  2. 3
    3
      Marlin/ultralcd.h
  3. 25
    25
      Marlin/ultralcd_impl_DOGM.h
  4. 16
    16
      Marlin/ultralcd_impl_HD44780.h
  5. 7
    7
      Marlin/utf_mapper.h

+ 5
- 5
Marlin/ultralcd.cpp View File

@@ -2250,7 +2250,7 @@ void kill_screen(const char* lcd_msg) {
2250 2250
       END_SCREEN();
2251 2251
     }
2252 2252
 
2253
-    void lcd_filament_change_show_message(FilamentChangeMessage message) {
2253
+    void lcd_filament_change_show_message(const FilamentChangeMessage message) {
2254 2254
       switch (message) {
2255 2255
         case FILAMENT_CHANGE_MESSAGE_INIT:
2256 2256
           defer_return_to_status = true;
@@ -2849,20 +2849,20 @@ void lcd_finishstatus(bool persist=false) {
2849 2849
 
2850 2850
 bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); }
2851 2851
 
2852
-void lcd_setstatus(const char* message, bool persist) {
2852
+void lcd_setstatus(const char* const message, bool persist) {
2853 2853
   if (lcd_status_message_level > 0) return;
2854 2854
   strncpy(lcd_status_message, message, 3 * (LCD_WIDTH));
2855 2855
   lcd_finishstatus(persist);
2856 2856
 }
2857 2857
 
2858
-void lcd_setstatuspgm(const char* message, uint8_t level) {
2858
+void lcd_setstatuspgm(const char* const message, uint8_t level) {
2859 2859
   if (level < lcd_status_message_level) return;
2860 2860
   lcd_status_message_level = level;
2861 2861
   strncpy_P(lcd_status_message, message, 3 * (LCD_WIDTH));
2862 2862
   lcd_finishstatus(level > 0);
2863 2863
 }
2864 2864
 
2865
-void lcd_setalertstatuspgm(const char* message) {
2865
+void lcd_setalertstatuspgm(const char* const message) {
2866 2866
   lcd_setstatuspgm(message, 1);
2867 2867
   #if ENABLED(ULTIPANEL)
2868 2868
     lcd_return_to_status();
@@ -2872,7 +2872,7 @@ void lcd_setalertstatuspgm(const char* message) {
2872 2872
 void lcd_reset_alert_level() { lcd_status_message_level = 0; }
2873 2873
 
2874 2874
 #if HAS_LCD_CONTRAST
2875
-  void set_lcd_contrast(int value) {
2875
+  void set_lcd_contrast(const int value) {
2876 2876
     lcd_contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX);
2877 2877
     u8g.setContrast(lcd_contrast);
2878 2878
   }

+ 3
- 3
Marlin/ultralcd.h View File

@@ -88,7 +88,7 @@
88 88
     void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual
89 89
 
90 90
     #if ENABLED(FILAMENT_CHANGE_FEATURE)
91
-      void lcd_filament_change_show_message(FilamentChangeMessage message);
91
+      void lcd_filament_change_show_message(const FilamentChangeMessage message);
92 92
     #endif // FILAMENT_CHANGE_FEATURE
93 93
 
94 94
   #else
@@ -156,8 +156,8 @@
156 156
   inline void lcd_update() {}
157 157
   inline void lcd_init() {}
158 158
   inline bool lcd_hasstatus() { return false; }
159
-  inline void lcd_setstatus(const char* message, const bool persist=false) { UNUSED(message); UNUSED(persist); }
160
-  inline void lcd_setstatuspgm(const char* message, const uint8_t level=0) { UNUSED(message); UNUSED(level); }
159
+  inline void lcd_setstatus(const char* const message, const bool persist=false) { UNUSED(message); UNUSED(persist); }
160
+  inline void lcd_setstatuspgm(const char* const message, const uint8_t level=0) { UNUSED(message); UNUSED(level); }
161 161
   inline void lcd_buttons_update() {}
162 162
   inline void lcd_reset_alert_level() {}
163 163
   inline bool lcd_detected() { return true; }

+ 25
- 25
Marlin/ultralcd_impl_DOGM.h View File

@@ -191,8 +191,8 @@ u8g_page_t &page = ((u8g_pb_t *)((u8g.getU8g())->dev->dev_mem))->p;
191 191
 #define PAGE_UNDER(yb) (u8g.getU8g()->current_page.y0 <= (yb))
192 192
 #define PAGE_CONTAINS(ya, yb) (PAGE_UNDER(yb) && u8g.getU8g()->current_page.y1 >= (ya))
193 193
 
194
-static void lcd_setFont(char font_nr) {
195
-  switch(font_nr) {
194
+static void lcd_setFont(const char font_nr) {
195
+  switch (font_nr) {
196 196
     case FONT_STATUSMENU : {u8g.setFont(FONT_STATUSMENU_NAME); currentfont = FONT_STATUSMENU;}; break;
197 197
     case FONT_MENU       : {u8g.setFont(FONT_MENU_NAME); currentfont = FONT_MENU;}; break;
198 198
     case FONT_SPECIAL    : {u8g.setFont(FONT_SPECIAL_NAME); currentfont = FONT_SPECIAL;}; break;
@@ -201,7 +201,7 @@ static void lcd_setFont(char font_nr) {
201 201
   }
202 202
 }
203 203
 
204
-void lcd_print(char c) {
204
+void lcd_print(const char c) {
205 205
   if ((c > 0) && (c <= LCD_STR_SPECIAL_MAX)) {
206 206
     u8g.setFont(FONT_SPECIAL_NAME);
207 207
     u8g.print(c);
@@ -210,7 +210,7 @@ void lcd_print(char c) {
210 210
   else charset_mapper(c);
211 211
 }
212 212
 
213
-char lcd_print_and_count(char c) {
213
+char lcd_print_and_count(const char c) {
214 214
   if ((c > 0) && (c <= LCD_STR_SPECIAL_MAX)) {
215 215
     u8g.setFont(FONT_SPECIAL_NAME);
216 216
     u8g.print(c);
@@ -220,7 +220,7 @@ char lcd_print_and_count(char c) {
220 220
   else return charset_mapper(c);
221 221
 }
222 222
 
223
-void lcd_print(const char* str) {
223
+void lcd_print(const char* const str) {
224 224
   for (uint8_t i = 0; char c = str[i]; ++i) lcd_print(c);
225 225
 }
226 226
 
@@ -268,15 +268,15 @@ static void lcd_implementation_init() {
268 268
       }
269 269
     #endif // SHOW_CUSTOM_BOOTSCREEN
270 270
 
271
-    int offx = (u8g.getWidth() - (START_BMPWIDTH)) / 2;
271
+    const uint8_t offx = (u8g.getWidth() - (START_BMPWIDTH)) / 2;
272 272
 
273 273
     #if ENABLED(START_BMPHIGH)
274
-      int offy = 0;
274
+      constexpr uint8_t offy = 0;
275 275
     #else
276
-      int offy = DOG_CHAR_HEIGHT;
276
+      constexpr uint8_t offy = DOG_CHAR_HEIGHT;
277 277
     #endif
278 278
 
279
-    int txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH)) / 2;
279
+    const uint8_t txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH)) / 2;
280 280
 
281 281
     if (show_bootscreen) {
282 282
       u8g.firstPage();
@@ -286,7 +286,7 @@ static void lcd_implementation_init() {
286 286
         #ifndef STRING_SPLASH_LINE2
287 287
           u8g.drawStr(txt1X, u8g.getHeight() - (DOG_CHAR_HEIGHT), STRING_SPLASH_LINE1);
288 288
         #else
289
-          int txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1) * (DOG_CHAR_WIDTH)) / 2;
289
+          const uint8_t txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1) * (DOG_CHAR_WIDTH)) / 2;
290 290
           u8g.drawStr(txt1X, u8g.getHeight() - (DOG_CHAR_HEIGHT) * 3 / 2, STRING_SPLASH_LINE1);
291 291
           u8g.drawStr(txt2X, u8g.getHeight() - (DOG_CHAR_HEIGHT) * 1 / 2, STRING_SPLASH_LINE2);
292 292
         #endif
@@ -315,14 +315,14 @@ static void lcd_implementation_clear() { } // Automatically cleared by Picture L
315 315
 // Status Screen
316 316
 //
317 317
 
318
-FORCE_INLINE void _draw_centered_temp(int temp, int x, int y) {
319
-  int degsize = 6 * (temp >= 100 ? 3 : temp >= 10 ? 2 : 1); // number's pixel width
318
+FORCE_INLINE void _draw_centered_temp(const int temp, const uint8_t x, const uint8_t y) {
319
+  const uint8_t degsize = 6 * (temp >= 100 ? 3 : temp >= 10 ? 2 : 1); // number's pixel width
320 320
   u8g.setPrintPos(x - (18 - degsize) / 2, y); // move left if shorter
321 321
   lcd_print(itostr3(temp));
322 322
   lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
323 323
 }
324 324
 
325
-FORCE_INLINE void _draw_heater_status(int x, int heater) {
325
+FORCE_INLINE void _draw_heater_status(const uint8_t x, const int8_t heater) {
326 326
   #if HAS_TEMP_BED
327 327
     bool isBed = heater < 0;
328 328
   #else
@@ -336,8 +336,8 @@ FORCE_INLINE void _draw_heater_status(int x, int heater) {
336 336
     _draw_centered_temp((isBed ? thermalManager.degBed() : thermalManager.degHotend(heater)) + 0.5, x, 28);
337 337
 
338 338
   if (PAGE_CONTAINS(17, 20)) {
339
-    uint8_t h = isBed ? 7 : 8,
340
-            y = isBed ? 18 : 17;
339
+    const uint8_t h = isBed ? 7 : 8,
340
+                  y = isBed ? 18 : 17;
341 341
     if (isBed ? thermalManager.isHeatingBed() : thermalManager.isHeatingHotend(heater)) {
342 342
       u8g.setColorIndex(0); // white on black
343 343
       u8g.drawBox(x + h, y, 2, 2);
@@ -349,7 +349,7 @@ FORCE_INLINE void _draw_heater_status(int x, int heater) {
349 349
   }
350 350
 }
351 351
 
352
-FORCE_INLINE void _draw_axis_label(AxisEnum axis, const char *pstr, bool blink) {
352
+FORCE_INLINE void _draw_axis_label(const AxisEnum axis, const char* const pstr, const bool blink) {
353 353
   if (blink)
354 354
     lcd_printPGM(pstr);
355 355
   else {
@@ -611,7 +611,7 @@ static void lcd_implementation_status_screen() {
611 611
   uint8_t row_y1, row_y2;
612 612
 
613 613
   // Set the colors for a menu item based on whether it is selected
614
-  static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
614
+  static void lcd_implementation_mark_as_selected(const uint8_t row, const bool isSelected) {
615 615
 
616 616
     row_y1 = row * (DOG_CHAR_HEIGHT) + 1;
617 617
     row_y2 = row_y1 + (DOG_CHAR_HEIGHT) - 1;
@@ -632,7 +632,7 @@ static void lcd_implementation_status_screen() {
632 632
   #if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE)
633 633
 
634 634
     // Draw a static line of text in the same idiom as a menu item
635
-    static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true, bool invert=false, const char* valstr=NULL) {
635
+    static void lcd_implementation_drawmenu_static(const uint8_t row, const char* pstr, const bool center=true, const bool invert=false, const char* valstr=NULL) {
636 636
 
637 637
       lcd_implementation_mark_as_selected(row, invert);
638 638
 
@@ -659,7 +659,7 @@ static void lcd_implementation_status_screen() {
659 659
   #endif // LCD_INFO_MENU || FILAMENT_CHANGE_FEATURE
660 660
 
661 661
   // Draw a generic menu item
662
-  static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, const char* pstr, char pre_char, char post_char) {
662
+  static void lcd_implementation_drawmenu_generic(const bool isSelected, const uint8_t row, const char* pstr, const char pre_char, const char post_char) {
663 663
     UNUSED(pre_char);
664 664
 
665 665
     lcd_implementation_mark_as_selected(row, isSelected);
@@ -684,7 +684,7 @@ static void lcd_implementation_status_screen() {
684 684
   #define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ')
685 685
 
686 686
   // Draw a menu item with an editable value
687
-  static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) {
687
+  static void _drawmenu_setting_edit_generic(const bool isSelected, const uint8_t row, const char* pstr, const char* const data, const bool pgm) {
688 688
 
689 689
     lcd_implementation_mark_as_selected(row, isSelected);
690 690
 
@@ -729,9 +729,9 @@ static void lcd_implementation_status_screen() {
729 729
   #define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
730 730
   #define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
731 731
 
732
-  void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) {
732
+  void lcd_implementation_drawedit(const char* const pstr, const char* const value=NULL) {
733
+    const uint8_t labellen = lcd_strlen_P(pstr), vallen = lcd_strlen(value);
733 734
     uint8_t lcd_width, char_width,
734
-            labellen = lcd_strlen_P(pstr), vallen = lcd_strlen(value),
735 735
             rows = (labellen > LCD_WIDTH - 2 - vallen) ? 2 : 1;
736 736
 
737 737
     #if ENABLED(USE_BIG_EDIT_FONT)
@@ -752,8 +752,8 @@ static void lcd_implementation_status_screen() {
752 752
     #endif
753 753
 
754 754
     // Center either one or two rows
755
-    uint8_t segmentHeight = u8g.getHeight() / (rows + 1), // 1 / (rows+1) = 1/2 or 1/3
756
-            baseline = segmentHeight + (DOG_CHAR_HEIGHT_EDIT + 1) / 2;
755
+    const uint8_t segmentHeight = u8g.getHeight() / (rows + 1); // 1 / (rows+1) = 1/2 or 1/3
756
+    uint8_t baseline = segmentHeight + (DOG_CHAR_HEIGHT_EDIT + 1) / 2;
757 757
 
758 758
     if (PAGE_CONTAINS(baseline + 1 - (DOG_CHAR_HEIGHT_EDIT), baseline)) {
759 759
       u8g.setPrintPos(0, baseline);
@@ -772,7 +772,7 @@ static void lcd_implementation_status_screen() {
772 772
 
773 773
   #if ENABLED(SDSUPPORT)
774 774
 
775
-    static void _drawmenu_sd(bool isSelected, uint8_t row, const char* pstr, const char* filename, char* const longFilename, bool isDir) {
775
+    static void _drawmenu_sd(const bool isSelected, const uint8_t row, const char* const pstr, const char* filename, char* const longFilename, const bool isDir) {
776 776
       UNUSED(pstr);
777 777
 
778 778
       lcd_implementation_mark_as_selected(row, isSelected);

+ 16
- 16
Marlin/ultralcd_impl_HD44780.h View File

@@ -195,7 +195,7 @@ extern volatile uint8_t buttons;  //an extended version of the last checked butt
195 195
 
196 196
 static void lcd_set_custom_characters(
197 197
   #if ENABLED(LCD_PROGRESS_BAR)
198
-    bool info_screen_charset = true
198
+    const bool info_screen_charset = true
199 199
   #endif
200 200
 ) {
201 201
   static byte bedTemp[8] = {
@@ -341,7 +341,7 @@ static void lcd_set_custom_characters(
341 341
 
342 342
 static void lcd_implementation_init(
343 343
   #if ENABLED(LCD_PROGRESS_BAR)
344
-    bool info_screen_charset = true
344
+    const bool info_screen_charset = true
345 345
   #endif
346 346
 ) {
347 347
 
@@ -385,7 +385,7 @@ void lcd_printPGM(const char *str) {
385 385
   for (; char c = pgm_read_byte(str); ++str) charset_mapper(c);
386 386
 }
387 387
 
388
-void lcd_print(const char* str) {
388
+void lcd_print(const char* const str) {
389 389
   for (uint8_t i = 0; char c = str[i]; ++i) charset_mapper(c);
390 390
 }
391 391
 
@@ -393,14 +393,14 @@ void lcd_print(char c) { charset_mapper(c); }
393 393
 
394 394
 #if ENABLED(SHOW_BOOTSCREEN)
395 395
 
396
-  void lcd_erase_line(int line) {
396
+  void lcd_erase_line(const int line) {
397 397
     lcd.setCursor(0, line);
398
-    for (int i = 0; i < LCD_WIDTH; i++)
398
+    for (uint8_t i = LCD_WIDTH + 1; --i;)
399 399
       lcd_print(' ');
400 400
   }
401 401
 
402 402
   // Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line
403
-  void lcd_scroll(int col, int line, const char* text, int len, int time) {
403
+  void lcd_scroll(const int col, const int line, const char* const text, const int len, const int time) {
404 404
     char tmp[LCD_WIDTH + 1] = {0};
405 405
     int n = max(lcd_strlen_P(text) - len, 0);
406 406
     for (int i = 0; i <= n; i++) {
@@ -411,7 +411,7 @@ void lcd_print(char c) { charset_mapper(c); }
411 411
     }
412 412
   }
413 413
 
414
-  static void logo_lines(const char *extra) {
414
+  static void logo_lines(const char* const extra) {
415 415
     int indent = (LCD_WIDTH - 8 - lcd_strlen_P(extra)) / 2;
416 416
     lcd.setCursor(indent, 0); lcd.print('\x00'); lcd_printPGM(PSTR( "------" ));  lcd.print('\x01');
417 417
     lcd.setCursor(indent, 1);                    lcd_printPGM(PSTR("|Marlin|"));  lcd_printPGM(extra);
@@ -552,7 +552,7 @@ void lcd_kill_screen() {
552 552
   lcd_printPGM(PSTR(MSG_PLEASE_RESET));
553 553
 }
554 554
 
555
-FORCE_INLINE void _draw_axis_label(AxisEnum axis, const char *pstr, bool blink) {
555
+FORCE_INLINE void _draw_axis_label(const AxisEnum axis, const char* const pstr, const bool blink) {
556 556
   if (blink)
557 557
     lcd_printPGM(pstr);
558 558
   else {
@@ -794,7 +794,7 @@ static void lcd_implementation_status_screen() {
794 794
 
795 795
   #if ENABLED(LCD_INFO_MENU) || ENABLED(FILAMENT_CHANGE_FEATURE)
796 796
 
797
-    static void lcd_implementation_drawmenu_static(uint8_t row, const char* pstr, bool center=true, bool invert=false, const char *valstr=NULL) {
797
+    static void lcd_implementation_drawmenu_static(const uint8_t row, const char* pstr, const bool center=true, const bool invert=false, const char *valstr=NULL) {
798 798
       UNUSED(invert);
799 799
       char c;
800 800
       int8_t n = LCD_WIDTH;
@@ -816,7 +816,7 @@ static void lcd_implementation_status_screen() {
816 816
 
817 817
   #endif // LCD_INFO_MENU || FILAMENT_CHANGE_FEATURE
818 818
 
819
-  static void lcd_implementation_drawmenu_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char post_char) {
819
+  static void lcd_implementation_drawmenu_generic(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char post_char) {
820 820
     char c;
821 821
     uint8_t n = LCD_WIDTH - 2;
822 822
     lcd.setCursor(0, row);
@@ -829,7 +829,7 @@ static void lcd_implementation_status_screen() {
829 829
     lcd.print(post_char);
830 830
   }
831 831
 
832
-  static void lcd_implementation_drawmenu_setting_edit_generic(bool sel, uint8_t row, const char* pstr, char pre_char, char* data) {
832
+  static void lcd_implementation_drawmenu_setting_edit_generic(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char* const data) {
833 833
     char c;
834 834
     uint8_t n = LCD_WIDTH - 2 - lcd_strlen(data);
835 835
     lcd.setCursor(0, row);
@@ -842,7 +842,7 @@ static void lcd_implementation_status_screen() {
842 842
     while (n--) lcd.print(' ');
843 843
     lcd_print(data);
844 844
   }
845
-  static void lcd_implementation_drawmenu_setting_edit_generic_P(bool sel, uint8_t row, const char* pstr, char pre_char, const char* data) {
845
+  static void lcd_implementation_drawmenu_setting_edit_generic_P(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char* const data) {
846 846
     char c;
847 847
     uint8_t n = LCD_WIDTH - 2 - lcd_strlen_P(data);
848 848
     lcd.setCursor(0, row);
@@ -879,7 +879,7 @@ static void lcd_implementation_status_screen() {
879 879
   #define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data)))
880 880
   #define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
881 881
 
882
-  void lcd_implementation_drawedit(const char* pstr, const char* value=NULL) {
882
+  void lcd_implementation_drawedit(const char* pstr, const char* const value=NULL) {
883 883
     lcd.setCursor(1, 1);
884 884
     lcd_printPGM(pstr);
885 885
     if (value != NULL) {
@@ -891,7 +891,7 @@ static void lcd_implementation_status_screen() {
891 891
 
892 892
   #if ENABLED(SDSUPPORT)
893 893
 
894
-    static void lcd_implementation_drawmenu_sd(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename, uint8_t concat, char post_char) {
894
+    static void lcd_implementation_drawmenu_sd(const bool sel, const uint8_t row, const char* const pstr, const char* filename, char* const longFilename, const uint8_t concat, const char post_char) {
895 895
       UNUSED(pstr);
896 896
       char c;
897 897
       uint8_t n = LCD_WIDTH - concat;
@@ -909,11 +909,11 @@ static void lcd_implementation_status_screen() {
909 909
       lcd.print(post_char);
910 910
     }
911 911
 
912
-    static void lcd_implementation_drawmenu_sdfile(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) {
912
+    static void lcd_implementation_drawmenu_sdfile(const bool sel, const uint8_t row, const char* pstr, const char* filename, char* const longFilename) {
913 913
       lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, ' ');
914 914
     }
915 915
 
916
-    static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const char* pstr, const char* filename, char* longFilename) {
916
+    static void lcd_implementation_drawmenu_sddirectory(const bool sel, const uint8_t row, const char* pstr, const char* filename, char* const longFilename) {
917 917
       lcd_implementation_drawmenu_sd(sel, row, pstr, filename, longFilename, 2, LCD_STR_FOLDER[0]);
918 918
     }
919 919
 

+ 7
- 7
Marlin/utf_mapper.h View File

@@ -150,7 +150,7 @@
150 150
 
151 151
 #if ENABLED(MAPPER_C2C3)
152 152
 
153
-  char charset_mapper(char c) {
153
+  char charset_mapper(const char c) {
154 154
     static uint8_t utf_hi_char; // UTF-8 high part
155 155
     static bool seen_c2 = false;
156 156
     uint8_t d = c;
@@ -181,7 +181,7 @@
181 181
 
182 182
 #elif ENABLED(MAPPER_CECF)
183 183
 
184
-  char charset_mapper(char c) {
184
+  char charset_mapper(const char c) {
185 185
     static uint8_t utf_hi_char; // UTF-8 high part
186 186
     static bool seen_ce = false;
187 187
     uint8_t d = c;
@@ -212,7 +212,7 @@
212 212
 
213 213
 #elif ENABLED(MAPPER_CECF)
214 214
 
215
-  char charset_mapper(char c) {
215
+  char charset_mapper(const char c) {
216 216
     static uint8_t utf_hi_char; // UTF-8 high part
217 217
     static bool seen_ce = false;
218 218
     uint8_t d = c;
@@ -243,7 +243,7 @@
243 243
 
244 244
 #elif ENABLED(MAPPER_D0D1_MOD)
245 245
 
246
-  char charset_mapper(char c) {
246
+  char charset_mapper(const char c) {
247 247
     // it is a Russian alphabet translation
248 248
     // except 0401 --> 0xa2 = Ё, 0451 --> 0xb5 = ё
249 249
     static uint8_t utf_hi_char; // UTF-8 high part
@@ -280,7 +280,7 @@
280 280
 
281 281
 #elif ENABLED(MAPPER_D0D1)
282 282
 
283
-  char charset_mapper(char c) {
283
+  char charset_mapper(const char c) {
284 284
     static uint8_t utf_hi_char; // UTF-8 high part
285 285
     static bool seen_d5 = false;
286 286
     uint8_t d = c;
@@ -311,7 +311,7 @@
311 311
 
312 312
 #elif ENABLED(MAPPER_E382E383)
313 313
 
314
-  char charset_mapper(char c) {
314
+  char charset_mapper(const char c) {
315 315
     static uint8_t utf_hi_char; // UTF-8 high part
316 316
     static bool seen_e3 = false;
317 317
     static bool seen_82_83 = false;
@@ -350,7 +350,7 @@
350 350
 
351 351
   #define MAPPER_NON
352 352
 
353
-  char charset_mapper(char c) {
353
+  char charset_mapper(const char c) {
354 354
     HARDWARE_CHAR_OUT( c );
355 355
     return 1;
356 356
   }

Loading…
Cancel
Save