Move common strings (#20846)

This commit is contained in:
Scott Lahteine
2021-01-22 15:01:19 -06:00
committed by GitHub
parent 7b9f7d8aba
commit d33fe2378c
38 changed files with 54 additions and 83 deletions

View File

@ -471,7 +471,6 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
// Show the Marlin logo and short build version
// After a delay show the website URL
//
extern const char NUL_STR[];
logo_lines(NUL_STR);
CENTER_OR_SCROLL(SHORT_BUILD_VERSION, 1500);
CENTER_OR_SCROLL(MARLIN_WEBSITE_URL, 1500);

View File

@ -544,8 +544,6 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
// Put Relevant Text on Display
extern const char X_LBL[], Y_LBL[], Z_LBL[];
// Show X and Y positions at top of screen
u8g.setColorIndex(1);
if (PAGE_UNDER(7)) {

View File

@ -703,7 +703,6 @@ void MarlinUI::draw_status_screen() {
lcd_put_u8str(estimation_x_pos, EXTRAS_BASELINE, estimation_string);
}
else if (elapsed_string[0]) {
extern const char E_LBL[];
lcd_put_u8str_P(PROGRESS_BAR_X, EXTRAS_BASELINE, E_LBL);
lcd_put_u8str(elapsed_x_pos, EXTRAS_BASELINE, elapsed_string);
}

View File

@ -35,8 +35,6 @@
#include "lib/dgus/DGUSDisplayDef.h"
#include "lib/dgus/DGUSScreenHandler.h"
extern const char NUL_STR[];
namespace ExtUI {
void onStartup() {

View File

@ -28,7 +28,7 @@
#include "../../../../libs/numtostr.h"
#include "../../../../module/motion.h" // for quickstop_stepper, A20 read printing speed, feedrate_percentage
#include "../../../../MarlinCore.h" // for disable_steppers, G28_STR
#include "../../../../MarlinCore.h" // for disable_steppers
#include "../../../../inc/MarlinConfig.h"
// command sending macro's with debugging capability

View File

@ -36,7 +36,6 @@ void FilamentRunoutScreen::onRedraw(draw_mode_t what) {
w.toggle( 2, GET_TEXT_F(MSG_RUNOUT_SENSOR), getFilamentRunoutEnabled());
#if HAS_FILAMENT_RUNOUT_DISTANCE
extern const char NUL_STR[];
w.heading(GET_TEXT_F(MSG_RUNOUT_DISTANCE_MM));
w.units(GET_TEXT_F(MSG_UNITS_MM));
w.precision(0);

View File

@ -120,7 +120,6 @@ void StressTestScreen::onIdle() {
if (!commandsInQueue()) {
if (!isPositionKnown()) {
extern const char G28_STR[];
injectCommands_P(G28_STR);
}
else {

View File

@ -31,8 +31,6 @@
#include "../../../../gcode/queue.h"
#include "../../../../inc/MarlinConfig.h"
extern const char G28_STR[];
extern lv_group_t *g;
static lv_obj_t *scr;

View File

@ -29,8 +29,6 @@
#include "../../../../gcode/queue.h"
#include "../../../../inc/MarlinConfig.h"
extern const char G28_STR[];
extern lv_group_t *g;
static lv_obj_t *scr;

View File

@ -21,15 +21,13 @@
*/
#include "../../../../inc/MarlinConfigPre.h"
#if HAS_TFT_LVGL_UI
#if BOTH(HAS_TFT_LVGL_UI, MKS_WIFI_MODULE)
#include "draw_ui.h"
#include "wifi_module.h"
#include "wifi_upload.h"
#include "SPI_TFT.h"
#if ENABLED(MKS_WIFI_MODULE)
#include "../../../../MarlinCore.h"
#include "../../../../module/temperature.h"
#include "../../../../gcode/queue.h"
@ -459,7 +457,6 @@ int package_to_wifi(WIFI_RET_TYPE type, uint8_t *buf, int len) {
return 1;
}
#define SEND_OK_TO_WIFI send_to_wifi((uint8_t *)"ok\r\n", strlen("ok\r\n"))
int send_to_wifi(uint8_t *buf, int len) { return package_to_wifi(WIFI_TRANS_INF, buf, len); }
@ -553,7 +550,6 @@ typedef struct {
uint8_t tail;
} ESP_PROTOC_FRAME;
static int cut_msg_head(uint8_t *msg, uint16_t msgLen, uint16_t cutLen) {
if (msgLen < cutLen) return 0;
@ -1707,7 +1703,6 @@ void mks_esp_wifi_init() {
wifi_link_state = WIFI_NOT_CONFIG;
}
void mks_wifi_firmware_update() {
card.openFileRead((char *)ESP_FIRMWARE_FILE);
@ -1826,5 +1821,4 @@ int readWifiBuf(int8_t *buf, int32_t len) {
return i;
}
#endif // MKS_WIFI_MODULE
#endif // HAS_TFT_LVGL_UI
#endif // HAS_TFT_LVGL_UI && MKS_WIFI_MODULE

View File

@ -1528,7 +1528,7 @@ void MarlinUI::update() {
void MarlinUI::resume_print() {
reset_status();
TERN_(PARK_HEAD_ON_PAUSE, wait_for_heatup = wait_for_user = false);
if (IS_SD_PAUSED()) queue.inject_P(M24_STR);
TERN_(SDSUPPORT, if (IS_SD_PAUSED()) queue.inject_P(M24_STR));
#ifdef ACTION_ON_RESUME
host_action_resume();
#endif

View File

@ -66,8 +66,6 @@
static_assert(LEVEL_CORNERS_Z_HOP >= 0, "LEVEL_CORNERS_Z_HOP must be >= 0. Please update your configuration.");
extern const char G28_STR[];
#if HAS_LEVELING
static bool leveling_was_active = false;
#endif
@ -205,7 +203,7 @@ static inline void _lcd_level_bed_corners_get_next_position() {
, []{ corner_probing_done = true; wait_for_probe = false; }
, []{ wait_for_probe = false; }
, GET_TEXT(MSG_LEVEL_CORNERS_RAISE)
, (const char*)nullptr, PSTR("")
, (const char*)nullptr, NUL_STR
);
}

View File

@ -161,8 +161,6 @@ void menu_advanced_settings();
#include "../../module/motion.h"
#include "../../gcode/queue.h"
extern const char G28_STR[];
void menu_tool_offsets() {
auto _recalc_offsets = []{

View File

@ -82,7 +82,6 @@ void _man_probe_pt(const xy_pos_t &xy) {
}
void _lcd_delta_calibrate_home() {
extern const char G28_STR[];
queue.inject_P(G28_STR);
ui.goto_screen(_lcd_calibrate_homing);
}

View File

@ -101,8 +101,6 @@ void menu_configuration();
void menu_language();
#endif
extern const char M21_STR[];
void menu_main() {
const bool busy = printingIsActive()
#if ENABLED(SDSUPPORT)
@ -156,7 +154,7 @@ void menu_main() {
if (!card_open) {
SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY);
#if PIN_EXISTS(SD_DETECT)
GCODES_ITEM(MSG_CHANGE_MEDIA, M21_STR);
GCODES_ITEM(MSG_CHANGE_MEDIA, PSTR("M21"));
#else
GCODES_ITEM(MSG_RELEASE_MEDIA, PSTR("M22"));
#endif
@ -166,7 +164,7 @@ void menu_main() {
#if PIN_EXISTS(SD_DETECT)
ACTION_ITEM(MSG_NO_MEDIA, nullptr);
#else
GCODES_ITEM(MSG_ATTACH_MEDIA, M21_STR);
GCODES_ITEM(MSG_ATTACH_MEDIA, PSTR("M21"));
#endif
}
@ -257,7 +255,7 @@ void menu_main() {
if (card_detected) {
if (!card_open) {
#if PIN_EXISTS(SD_DETECT)
GCODES_ITEM(MSG_CHANGE_MEDIA, M21_STR);
GCODES_ITEM(MSG_CHANGE_MEDIA, PSTR("M21"));
#else
GCODES_ITEM(MSG_RELEASE_MEDIA, PSTR("M22"));
#endif
@ -268,7 +266,7 @@ void menu_main() {
#if PIN_EXISTS(SD_DETECT)
ACTION_ITEM(MSG_NO_MEDIA, nullptr);
#else
GCODES_ITEM(MSG_ATTACH_MEDIA, M21_STR);
GCODES_ITEM(MSG_ATTACH_MEDIA, PSTR("M21"));
#endif
}
}

View File

@ -51,8 +51,6 @@
float manual_move_e_origin = 0;
#endif
extern const char G28_STR[];
//
// "Motion" > "Move Axis" submenu
//
@ -191,7 +189,6 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int
sprintf_P(tmp, label, dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr));
#if DISABLED(HAS_GRAPHICAL_TFT)
extern const char NUL_STR[];
SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(FINE_MANUAL_MOVE)); });
MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
lcd_put_u8str(tmp);

View File

@ -49,7 +49,7 @@ void Password::menu_password_entry() {
// "Login" or "New Code"
STATIC_ITEM_P(authenticating ? GET_TEXT(MSG_LOGIN_REQUIRED) : GET_TEXT(MSG_EDIT_PASSWORD), SS_CENTER|SS_INVERT);
STATIC_ITEM_P(PSTR(""), SS_CENTER|SS_INVERT, string);
STATIC_ITEM_P(NUL_STR, SS_CENTER|SS_INVERT, string);
// Make the digit edit item look like a sub-menu
PGM_P const label = GET_TEXT(MSG_ENTER_DIGIT);

View File

@ -88,7 +88,6 @@ void probe_offset_wizard_menu() {
!UNEAR_ZERO((FINE_MANUAL_MOVE) * 100 - int((FINE_MANUAL_MOVE) * 100)) ? 3 : 2;
sprintf_P(tmp, GET_TEXT(MSG_MOVE_N_MM), dtostrf(FINE_MANUAL_MOVE, 1, digs, numstr));
#if DISABLED(HAS_GRAPHICAL_TFT)
extern const char NUL_STR[];
SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(FINE_MANUAL_MOVE)); });
MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
lcd_put_u8str(tmp);

View File

@ -867,7 +867,7 @@ static void moveAxis(AxisEnum axis, const int8_t direction) {
NOMORE(ui.manual_move.offset, max - current_position[axis]);
#else
current_position[axis] += diff;
const char *msg = PSTR(""); // clear the error
const char *msg = NUL_STR; // clear the error
if (direction < 0 && current_position[axis] < min) {
current_position[axis] = min;
msg = GET_TEXT(MSG_LCD_SOFT_ENDSTOPS);