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

@ -188,7 +188,7 @@ G29_TYPE GcodeSuite::G29() {
// Send 'N' to force homing before G29 (internal only)
if (parser.seen('N'))
gcode.process_subcommands_now_P(TERN(G28_L0_ENSURES_LEVELING_OFF, PSTR("G28L0"), G28_STR));
process_subcommands_now_P(TERN(G28_L0_ENSURES_LEVELING_OFF, PSTR("G28L0"), G28_STR));
// Don't allow auto-leveling without homing first
if (homing_needed_error()) G29_RETURN(false);

View File

@ -38,7 +38,7 @@
#include "../../feature/probe_temp_comp.h"
#include "../../lcd/marlinui.h"
#include "../../MarlinCore.h" // for wait_for_heatup, idle(), G28_STR
#include "../../MarlinCore.h" // for wait_for_heatup, idle()
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
#include "../../module/printcounter.h"

View File

@ -51,8 +51,6 @@
* This function requires the machine to be homed before invocation.
*/
extern const char SP_Y_STR[];
void GcodeSuite::M48() {
if (homing_needed_error()) return;

View File

@ -33,8 +33,6 @@
#include "../../MarlinCore.h" // for SP_X_STR, etc.
extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[];
void M217_report(const bool eeprom=false) {
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)

View File

@ -25,7 +25,7 @@
#if DISABLED(EMERGENCY_PARSER)
#include "../gcode.h"
#include "../../MarlinCore.h" // for wait_for_heatup, kill
#include "../../MarlinCore.h" // for wait_for_heatup, kill, M112_KILL_STR
#include "../../module/motion.h" // for quickstop_stepper
/**

View File

@ -310,6 +310,8 @@
enum AxisRelative : uint8_t { REL_X, REL_Y, REL_Z, REL_E, E_MODE_ABS, E_MODE_REL };
extern const char G28_STR[];
class GcodeSuite {
public:
@ -371,7 +373,6 @@ public:
static void process_subcommands_now(char * gcode);
static inline void home_all_axes(const bool keep_leveling=false) {
extern const char G28_STR[];
process_subcommands_now_P(keep_leveling ? G28_STR : TERN(G28_L0_ENSURES_LEVELING_OFF, PSTR("G28L0"), G28_STR));
}

View File

@ -30,8 +30,6 @@
#include "../../libs/buzzer.h"
#include "../../MarlinCore.h"
extern const char SP_Y_STR[], SP_Z_STR[];
void m206_report() {
SERIAL_ECHOLNPAIR_P(PSTR("M206 X"), home_offset.x, SP_Y_STR, home_offset.y, SP_Z_STR, home_offset.z);
}

View File

@ -28,8 +28,6 @@
#include "../../feature/bedlevel/bedlevel.h"
#include "../../module/probe.h"
extern const char SP_Y_STR[], SP_Z_STR[];
/**
* M851: Set the nozzle-to-probe offsets in current units
*/

View File

@ -56,6 +56,9 @@ GCodeQueue queue;
#include "../feature/repeat.h"
#endif
// Frequently used G-code strings
PGMSTR(G28_STR, "G28");
/**
* GCode line number handling. Hosts may opt to include line numbers when
* sending commands to Marlin, and lines will be checked for sequentiality.

View File

@ -186,3 +186,5 @@ private:
};
extern GCodeQueue queue;
extern const char G28_STR[];