Browse Source

Merge pull request #3176 from thinkyhead/rc_patch_3149_part_ii

Use const parameters in lcd_implementation_drawedit (etc.)
Scott Lahteine 8 years ago
parent
commit
7f2375ab46

+ 2
- 2
Marlin/dogm_lcd_implementation.h View File

@@ -169,7 +169,7 @@ char lcd_print(char c) {
169 169
   }
170 170
 }
171 171
 
172
-char lcd_print(char* str) {
172
+char lcd_print(const char* str) {
173 173
   char c;
174 174
   int i = 0;
175 175
   char n = 0;
@@ -508,7 +508,7 @@ static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const c
508 508
 #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, ftostr5(*(data)))
509 509
 #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))
510 510
 
511
-void lcd_implementation_drawedit(const char* pstr, char* value) {
511
+void lcd_implementation_drawedit(const char* pstr, const char* value) {
512 512
   uint8_t rows = 1;
513 513
   uint8_t lcd_width = LCD_WIDTH, char_width = DOG_CHAR_WIDTH;
514 514
   uint8_t vallen = lcd_strlen(value);

+ 1
- 0
Marlin/language_an.h View File

@@ -20,6 +20,7 @@
20 20
 #define MSG_AUTOSTART                       " Autostart"
21 21
 #define MSG_DISABLE_STEPPERS                "Amortar motors"
22 22
 #define MSG_AUTO_HOME                       "Levar a l'orichen"
23
+#define MSG_LEVEL_BED_HOMING                "Homing"
23 24
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
24 25
 #define MSG_SET_ORIGIN                      "Establir zero"
25 26
 #define MSG_PREHEAT_PLA                     "Precalentar PLA"

+ 1
- 0
Marlin/language_bg.h View File

@@ -20,6 +20,7 @@
20 20
 #define MSG_AUTOSTART                       "Автостарт"
21 21
 #define MSG_DISABLE_STEPPERS                "Изкл. двигатели"
22 22
 #define MSG_AUTO_HOME                       "Паркиране"
23
+#define MSG_LEVEL_BED_HOMING                "Homing"
23 24
 #define MSG_SET_HOME_OFFSETS                "Задай Начало"
24 25
 #define MSG_SET_ORIGIN                      "Изходна точка"
25 26
 #define MSG_PREHEAT_PLA                     "Подгряване PLA"

+ 1
- 0
Marlin/language_ca.h View File

@@ -21,6 +21,7 @@
21 21
 #define MSG_AUTOSTART                       "Inici automatic"
22 22
 #define MSG_DISABLE_STEPPERS                "Apagar motors"
23 23
 #define MSG_AUTO_HOME                       "Home global"
24
+#define MSG_LEVEL_BED_HOMING                "Homing"
24 25
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
25 26
 #define MSG_SET_ORIGIN                      "Establir origen"
26 27
 #define MSG_PREHEAT_PLA                     "Preescalfar PLA"

+ 1
- 0
Marlin/language_cn.h View File

@@ -18,6 +18,7 @@
18 18
 #define MSG_AUTOSTART                       "\xb1\xb2\xb3\xb4"
19 19
 #define MSG_DISABLE_STEPPERS                "\xb5\xb6\xb7\xb8\xb9\xba"
20 20
 #define MSG_AUTO_HOME                       "\xbb\xbc\xbd"
21
+#define MSG_LEVEL_BED_HOMING                "Homing"
21 22
 #define MSG_SET_HOME_OFFSETS                "\xbe\xbf\xbb\xbc\xbd\xc0\xc1"
22 23
 #define MSG_SET_ORIGIN                      "\xbe\xbf\xbc\xbd"
23 24
 #define MSG_PREHEAT_PLA                     "\xc3\xc4 PLA"

+ 1
- 0
Marlin/language_cz.h View File

@@ -24,6 +24,7 @@
24 24
 #define MSG_AUTOSTART                       "Autostart"
25 25
 #define MSG_DISABLE_STEPPERS                "Uvolnit motory"
26 26
 #define MSG_AUTO_HOME                       "Domovska pozice"
27
+#define MSG_LEVEL_BED_HOMING                "Homing"
27 28
 #define MSG_SET_HOME_OFFSETS                "Nastavit ofsety"
28 29
 #define MSG_SET_ORIGIN                      "Nastavit pocatek"
29 30
 #define MSG_PREHEAT_PLA                     "Zahrat PLA"

+ 1
- 0
Marlin/language_da.h View File

@@ -21,6 +21,7 @@
21 21
 #define MSG_AUTO_HOME                       "Home" // G28
22 22
 #define MSG_COOLDOWN                        "Afkøl"
23 23
 #define MSG_DISABLE_STEPPERS                "Slå stepper fra"
24
+#define MSG_LEVEL_BED_HOMING                "Homing"
24 25
 #define MSG_SET_HOME_OFFSETS                "Sæt home offsets"
25 26
 #define MSG_SET_ORIGIN                      "Sæt origin"
26 27
 #define MSG_SWITCH_PS_ON                    "Slå strøm til"

+ 1
- 0
Marlin/language_de.h View File

@@ -20,6 +20,7 @@
20 20
 #define MSG_AUTOSTART                       "Autostart"
21 21
 #define MSG_DISABLE_STEPPERS                "Motoren Aus" // M84
22 22
 #define MSG_AUTO_HOME                       "Home" // G28
23
+#define MSG_LEVEL_BED_HOMING                "Homing"
23 24
 #define MSG_SET_HOME_OFFSETS                "Setze Home hier"
24 25
 #define MSG_SET_ORIGIN                      "Setze Null hier" //"G92 X0 Y0 Z0" commented out in ultralcd.cpp
25 26
 #define MSG_PREHEAT_PLA                     "Vorwärmen PLA"

+ 3
- 0
Marlin/language_en.h View File

@@ -39,6 +39,9 @@
39 39
 #ifndef MSG_AUTO_HOME
40 40
   #define MSG_AUTO_HOME                       "Auto home"
41 41
 #endif
42
+#ifndef MSG_LEVEL_BED_HOMING
43
+  #define MSG_LEVEL_BED_HOMING                "Homing"
44
+#endif
42 45
 #ifndef MSG_SET_HOME_OFFSETS
43 46
   #define MSG_SET_HOME_OFFSETS                "Set home offsets"
44 47
 #endif

+ 1
- 0
Marlin/language_es.h View File

@@ -20,6 +20,7 @@
20 20
 #define MSG_AUTOSTART                       "Autostart"
21 21
 #define MSG_DISABLE_STEPPERS                "Apagar motores"
22 22
 #define MSG_AUTO_HOME                       "Llevar al origen"
23
+#define MSG_LEVEL_BED_HOMING                "Homing"
23 24
 #define MSG_SET_HOME_OFFSETS                "Ajustar offsets"
24 25
 #define MSG_SET_ORIGIN                      "Establecer cero"
25 26
 #define MSG_PREHEAT_PLA                     "Precalentar PLA"

+ 1
- 0
Marlin/language_eu.h View File

@@ -20,6 +20,7 @@
20 20
 #define MSG_AUTOSTART                       "Auto hasiera"
21 21
 #define MSG_DISABLE_STEPPERS                "Itzali motoreak"
22 22
 #define MSG_AUTO_HOME                       "Hasierara joan"
23
+#define MSG_LEVEL_BED_HOMING                "Homing"
23 24
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
24 25
 #define MSG_SET_ORIGIN                      "Hasiera ipini"
25 26
 #define MSG_PREHEAT_PLA                     "Aurreberotu PLA"

+ 1
- 0
Marlin/language_fi.h View File

@@ -20,6 +20,7 @@
20 20
 #define MSG_AUTOSTART                       "Automaatti"
21 21
 #define MSG_DISABLE_STEPPERS                "Vapauta moottorit"
22 22
 #define MSG_AUTO_HOME                       "Aja referenssiin"
23
+#define MSG_LEVEL_BED_HOMING                "Homing"
23 24
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
24 25
 #define MSG_SET_ORIGIN                      "Aseta origo"
25 26
 #define MSG_PREHEAT_PLA                     "Esilämmitä PLA"

+ 1
- 0
Marlin/language_fr.h View File

@@ -21,6 +21,7 @@
21 21
 #define MSG_AUTOSTART                       "Demarrage auto"
22 22
 #define MSG_DISABLE_STEPPERS                "Arreter moteurs"
23 23
 #define MSG_AUTO_HOME                       "Home auto."
24
+#define MSG_LEVEL_BED_HOMING                "Homing"
24 25
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
25 26
 #define MSG_SET_ORIGIN                      "Regler origine"
26 27
 #define MSG_PREHEAT_PLA                     "Prechauffage PLA"

+ 1
- 0
Marlin/language_it.h View File

@@ -20,6 +20,7 @@
20 20
 #define MSG_AUTOSTART                       "Autostart"
21 21
 #define MSG_DISABLE_STEPPERS                "Disabilita Motori"
22 22
 #define MSG_AUTO_HOME                       "Auto Home"
23
+#define MSG_LEVEL_BED_HOMING                "Homing"
23 24
 #define MSG_SET_HOME_OFFSETS                "Setta offset home"
24 25
 #define MSG_SET_ORIGIN                      "Imposta Origine"
25 26
 #define MSG_PREHEAT_PLA                     "Preriscalda PLA"

+ 1
- 0
Marlin/language_kana.h View File

@@ -22,6 +22,7 @@
22 22
 #define MSG_AUTOSTART                       "\xbc\xde\xc4\xde\xb3\xb6\xb2\xbc"                             // "Autostart"
23 23
 #define MSG_DISABLE_STEPPERS                "\xd3\xb0\xc0\xb0\xc3\xde\xdd\xb9\xde\xdd\x20\xb5\xcc"         // "Disable steppers"
24 24
 #define MSG_AUTO_HOME                       "\xb9\xde\xdd\xc3\xdd\xc6\xb2\xc4\xde\xb3"                     // "Auto home"
25
+#define MSG_LEVEL_BED_HOMING                "Homing"
25 26
 #define MSG_SET_HOME_OFFSETS                "\xb7\xbc\xde\xad\xdd\xb5\xcc\xbe\xaf\xc4\xbe\xaf\xc3\xb2"     // "Set home offsets"
26 27
 #define MSG_SET_ORIGIN                      "\xb7\xbc\xde\xad\xdd\xbe\xaf\xc4"                             // "Set origin"
27 28
 #define MSG_PREHEAT_PLA                     "PLA \xd6\xc8\xc2"                                             // "Preheat PLA"

+ 1
- 0
Marlin/language_kana_utf8.h View File

@@ -26,6 +26,7 @@
26 26
 #define MSG_AUTOSTART                       "ジドウカイシ"                   // "Autostart"
27 27
 #define MSG_DISABLE_STEPPERS                "モーターデンゲン オフ"             // "Disable steppers"
28 28
 #define MSG_AUTO_HOME                       "ゲンテンニイドウ"                // "Auto home"
29
+#define MSG_LEVEL_BED_HOMING                "Homing"
29 30
 #define MSG_SET_HOME_OFFSETS                "キジュンオフセットセッテイ"         // "Set home offsets"
30 31
 #define MSG_SET_ORIGIN                      "キジュンセット"                 // "Set origin"
31 32
 #define MSG_PREHEAT_PLA                     "PLA ヨネツ"                    // "Preheat PLA"

+ 1
- 0
Marlin/language_nl.h View File

@@ -20,6 +20,7 @@
20 20
 #define MSG_AUTOSTART                       "Autostart"
21 21
 #define MSG_DISABLE_STEPPERS                "Motoren uit"
22 22
 #define MSG_AUTO_HOME                       "Auto home"
23
+#define MSG_LEVEL_BED_HOMING                "Homing"
23 24
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
24 25
 #define MSG_SET_ORIGIN                      "Nulpunt instellen"
25 26
 #define MSG_PREHEAT_PLA                     "PLA voorverwarmen"

+ 1
- 0
Marlin/language_pl.h View File

@@ -20,6 +20,7 @@
20 20
 #define MSG_AUTOSTART                       "Autostart"
21 21
 #define MSG_DISABLE_STEPPERS                "Wylacz silniki"
22 22
 #define MSG_AUTO_HOME                       "Auto. poz. zerowa"
23
+#define MSG_LEVEL_BED_HOMING                "Homing"
23 24
 #define MSG_SET_HOME_OFFSETS                "Set home offsets"
24 25
 #define MSG_SET_ORIGIN                      "Ustaw punkt zero"
25 26
 #define MSG_PREHEAT_PLA                     "Rozgrzej PLA"

+ 1
- 0
Marlin/language_pt-br.h View File

@@ -20,6 +20,7 @@
20 20
 #define MSG_AUTOSTART                       "Autostart"
21 21
 #define MSG_DISABLE_STEPPERS                "Desabi. motores"
22 22
 #define MSG_AUTO_HOME                       "Ir para origen"
23
+#define MSG_LEVEL_BED_HOMING                "Homing"
23 24
 #define MSG_SET_HOME_OFFSETS                "Ajustar Jogo"
24 25
 #define MSG_SET_ORIGIN                      "Ajustar orig."
25 26
 #define MSG_PREHEAT_PLA                     "Pre-aquecer PLA"

+ 1
- 0
Marlin/language_pt-br_utf.h View File

@@ -20,6 +20,7 @@
20 20
 #define MSG_AUTOSTART                       "Autostart"
21 21
 #define MSG_DISABLE_STEPPERS                "Desabi. motores"
22 22
 #define MSG_AUTO_HOME                       "Ir para origen"
23
+#define MSG_LEVEL_BED_HOMING                "Homing"
23 24
 #define MSG_SET_HOME_OFFSETS                "Ajustar Jogo"
24 25
 #define MSG_SET_ORIGIN                      "Ajustar orig."
25 26
 #define MSG_PREHEAT_PLA                     "Pre-aquecer PLA"

+ 1
- 0
Marlin/language_pt.h View File

@@ -20,6 +20,7 @@
20 20
 #define MSG_AUTOSTART                       "Autostart"
21 21
 #define MSG_DISABLE_STEPPERS                " Desactivar motores"
22 22
 #define MSG_AUTO_HOME                       "Ir para origem"
23
+#define MSG_LEVEL_BED_HOMING                "Homing"
23 24
 #define MSG_SET_HOME_OFFSETS                "Def. desvio origem"
24 25
 #define MSG_SET_ORIGIN                      "Definir origem"
25 26
 #define MSG_PREHEAT_PLA                     "Pre-aquecer PLA"

+ 1
- 0
Marlin/language_ru.h View File

@@ -20,6 +20,7 @@
20 20
 #define MSG_AUTOSTART                       "Автостарт"
21 21
 #define MSG_DISABLE_STEPPERS                "Выкл. двигатели"
22 22
 #define MSG_AUTO_HOME                       "Парковка"
23
+#define MSG_LEVEL_BED_HOMING                "Homing"
23 24
 #define MSG_SET_HOME_OFFSETS                "Запомнить парковку"
24 25
 #define MSG_SET_ORIGIN                      "Запомнить ноль"
25 26
 #define MSG_PREHEAT_PLA                     "Преднагрев PLA"

+ 3
- 3
Marlin/ultralcd.cpp View File

@@ -516,7 +516,7 @@ void lcd_set_home_offsets() {
516 516
         babystepsTodo[axis] += distance;
517 517
       #endif
518 518
     }
519
-    if (lcdDrawUpdate) lcd_implementation_drawedit(msg, (char*)"");
519
+    if (lcdDrawUpdate) lcd_implementation_drawedit(msg, PSTR(""));
520 520
     if (LCD_CLICKED) lcd_goto_previous_menu();
521 521
   }
522 522
 
@@ -1715,7 +1715,7 @@ void lcd_init() {
1715 1715
   #endif
1716 1716
 }
1717 1717
 
1718
-int lcd_strlen(char* s) {
1718
+int lcd_strlen(const char* s) {
1719 1719
   int i = 0, j = 0;
1720 1720
   while (s[i]) {
1721 1721
     if ((s[i] & 0xc0) != 0x80) j++;
@@ -2397,7 +2397,7 @@ char* ftostr52(const float& x) {
2397 2397
    * MBL Move to mesh starting point
2398 2398
    */
2399 2399
   static void _lcd_level_bed_homing() {
2400
-    if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("XYZ"), (char*)"Homing");
2400
+    if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR("XYZ"), PSTR(MSG_LEVEL_BED_HOMING));
2401 2401
     if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]) {
2402 2402
       current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2403 2403
       plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);

+ 1
- 1
Marlin/ultralcd.h View File

@@ -5,7 +5,7 @@
5 5
 #if ENABLED(ULTRA_LCD)
6 6
   #include "buzzer.h"
7 7
 
8
-  int lcd_strlen(char* s);
8
+  int lcd_strlen(const char* s);
9 9
   int lcd_strlen_P(const char* s);
10 10
   void lcd_update();
11 11
   void lcd_init();

+ 2
- 2
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -407,7 +407,7 @@ char lcd_printPGM(const char* str) {
407 407
   return n;
408 408
 }
409 409
 
410
-char lcd_print(char* str) {
410
+char lcd_print(const char* str) {
411 411
   char c, n = 0;
412 412
   unsigned char i = 0;
413 413
   while ((c = str[i++])) n += charset_mapper(c);
@@ -825,7 +825,7 @@ static void lcd_implementation_drawmenu_setting_edit_generic_P(bool sel, uint8_t
825 825
 #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, '>', ftostr5(*(data)))
826 826
 #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))
827 827
 
828
-void lcd_implementation_drawedit(const char* pstr, char* value) {
828
+void lcd_implementation_drawedit(const char* pstr, const char* value) {
829 829
   lcd.setCursor(1, 1);
830 830
   lcd_printPGM(pstr);
831 831
   lcd.print(':');

Loading…
Cancel
Save