From 15f94e5ee5eb35aab7d8121eeabf2b1b01104f43 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 2 Nov 2019 07:09:57 -0500 Subject: [PATCH] Add NUL_STR global --- Marlin/src/Marlin.cpp | 3 ++- Marlin/src/Marlin.h | 2 +- Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp | 3 ++- Marlin/src/lcd/extui_dgus_lcd.cpp | 3 ++- Marlin/src/lcd/menu/menu_motion.cpp | 3 ++- Marlin/src/module/temperature.cpp | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 7be88a0c7e..e69e4be21b 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -184,7 +184,8 @@ const char G28_STR[] PROGMEM = "G28", M21_STR[] PROGMEM = "M21", M23_STR[] PROGMEM = "M23 %s", - M24_STR[] PROGMEM = "M24"; + M24_STR[] PROGMEM = "M24", + NUL_STR[] PROGMEM = ""; bool Running = true; diff --git a/Marlin/src/Marlin.h b/Marlin/src/Marlin.h index 657e0660a8..05407a40ab 100644 --- a/Marlin/src/Marlin.h +++ b/Marlin/src/Marlin.h @@ -377,4 +377,4 @@ void protected_pin_err(); void event_probe_failure(); #endif -extern const char G28_STR[], M21_STR[], M23_STR[], M24_STR[]; +extern const char G28_STR[], M21_STR[], M23_STR[], M24_STR[], NUL_STR[]; diff --git a/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp b/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp index 8103efe2cd..880caad96b 100644 --- a/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp @@ -464,7 +464,8 @@ void MarlinUI::clear_lcd() { lcd.clear(); } // Show the Marlin logo and short build version // After a delay show the website URL // - logo_lines(PSTR("")); + extern const char NUL_STR[]; + logo_lines(NUL_STR); CENTER_OR_SCROLL(SHORT_BUILD_VERSION, 1500); CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 1500); #ifdef STRING_SPLASH_LINE3 diff --git a/Marlin/src/lcd/extui_dgus_lcd.cpp b/Marlin/src/lcd/extui_dgus_lcd.cpp index e57355bcd0..c2daacd70a 100644 --- a/Marlin/src/lcd/extui_dgus_lcd.cpp +++ b/Marlin/src/lcd/extui_dgus_lcd.cpp @@ -44,7 +44,8 @@ namespace ExtUI { void onIdle() { ScreenHandler.loop(); } void onPrinterKilled(PGM_P error, PGM_P component) { - ScreenHandler.sendinfoscreen(GET_TEXT(MSG_HALTED), error, PSTR(""), GET_TEXT(MSG_PLEASE_RESET), true, true, true, true); + extern const char NUL_STR[]; + ScreenHandler.sendinfoscreen(GET_TEXT(MSG_HALTED), error, NUL_STR, GET_TEXT(MSG_PLEASE_RESET), true, true, true, true); ScreenHandler.GotoScreen(DGUSLCD_SCREEN_KILL); while (!ScreenHandler.loop()); // Wait while anything is left to be sent } diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index cc15c19eca..07b2223d38 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -256,7 +256,8 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move( 1); }); SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move( 0.1f); }); if (axis == Z_AXIS && (SHORT_MANUAL_Z_MOVE) > 0.0f && (SHORT_MANUAL_Z_MOVE) < 0.1f) { - SUBMENU_P(PSTR(""), []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); }); + extern const char NUL_STR[]; + SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); }); MENU_ITEM_ADDON_START(0); char tmp[20], numstr[10]; // Determine digits needed right of decimal diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 6f62854e83..601e83ebd0 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -539,7 +539,7 @@ volatile bool Temperature::temp_meas_ready = false; SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_FINISHED); #if HAS_PID_FOR_BOTH - const char * const estring = GHV(PSTR("bed"), PSTR("")); + const char * const estring = GHV(PSTR("bed"), NUL_STR); say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Kp ", tune_pid.Kp); say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Ki ", tune_pid.Ki); say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Kd ", tune_pid.Kd);