This commit is contained in:
Andrew 2026-02-27 20:43:33 -06:00 committed by GitHub
commit ba6cbc64b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 19 additions and 28 deletions

View file

@ -282,7 +282,7 @@ Marlin marlin;
// Marlin static data
#if ENABLED(CONFIGURABLE_MACHINE_NAME)
MString<64> Marlin::machine_name;
TString Marlin::machine_name;
#endif
// Global state of the firmware

View file

@ -48,7 +48,7 @@ void safe_delay(millis_t ms);
class Marlin {
public:
#if ENABLED(CONFIGURABLE_MACHINE_NAME)
static MString<64> machine_name;
static TString machine_name;
#endif
static MarlinState state;

View file

@ -28,31 +28,27 @@
#include "../../lcd/marlinui.h"
/**
* M550: Set machine name
* M550: Set or Report Machine Name
*
* Parameters:
* P "<name>" Set the name using the 'P' parameter (RepRapFirmware)
* "<name>" Set the name using the "string" parameter
* <name> - Set the name using the "string" parameter
*
* With GCODE_QUOTED_STRINGS:
* "<name>" - Set the name using the "string" parameter in quotes
* NOTE: Works with or without quotes
*
* Without parameters, this reports the current machine name
*/
void GcodeSuite::M550() {
bool did_set = true;
if (parser.seenval('P'))
marlin.machine_name = parser.value_string();
else if (TERN(GCODE_QUOTED_STRINGS, false, parser.seen('P')))
marlin.machine_name = parser.string_arg[0] == 'P' ? &parser.string_arg[1] : parser.string_arg;
else if (parser.has_string())
marlin.machine_name = parser.string_arg;
else
did_set = false;
if (did_set) {
marlin.machine_name.trim();
ui.reset_status(false);
}
else
if (parser.has_string()) {
marlin.machine_name = parser.string_arg;
marlin.machine_name.trim();
}
else {
SERIAL_ECHOLNPGM("RepRap name: ", &marlin.machine_name);
return;
}
ui.reset_status(false);
}
#endif // CONFIGURABLE_MACHINE_NAME

View file

@ -4556,10 +4556,6 @@ static_assert(WITHIN(MULTISTEPPING_LIMIT, 1, 128) && IS_POWER_OF_2(MULTISTEPPING
#error "Only enable ULTIPANEL_FEEDMULTIPLY or ULTIPANEL_FLOWPERCENT, but not both."
#endif
#if ENABLED(CONFIGURABLE_MACHINE_NAME) && DISABLED(GCODE_QUOTED_STRINGS)
#error "CONFIGURABLE_MACHINE_NAME requires GCODE_QUOTED_STRINGS."
#endif
/**
* Shared Microstepping Pins Sanity Check
*/

View file

@ -1618,7 +1618,6 @@ uint8_t expand_u8str_P(char * const outstr, PGM_P const ptpl, const int8_t ind,
msg = GET_TEXT_F(WELCOME_MSG);
#endif
}
else if (ENABLED(STATUS_DO_CLEAR_EMPTY))
msg = F("");
else

View file

@ -588,7 +588,7 @@ typedef struct SettingsDataStruct {
// CONFIGURABLE_MACHINE_NAME
//
#if ENABLED(CONFIGURABLE_MACHINE_NAME)
MString<64> machine_name; // M550 P
TString machine_name; // M550
#endif
//