File tree Expand file tree Collapse file tree 6 files changed +7
-5
lines changed Expand file tree Collapse file tree 6 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ void GcodeSuite::M550() {
42
42
machine_name = parser.value_string ();
43
43
else if (TERN (GCODE_QUOTED_STRINGS, false , parser.seen (' P' )))
44
44
machine_name = parser.string_arg [0 ] == ' P' ? &parser.string_arg [1 ] : parser.string_arg ;
45
- else if (parser.string_arg && parser. string_arg [ 0 ] )
45
+ else if (parser.has_string () )
46
46
machine_name = parser.string_arg ;
47
47
else
48
48
did_set = false ;
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ void GcodeSuite::T(const int8_t tool_index) {
69
69
reset_stepper_timeout ();
70
70
71
71
#if HAS_PRUSA_MMU3
72
- if (parser.string_arg ) {
72
+ if (parser.has_string () ) {
73
73
mmu3.tool_change (parser.string_arg [0 ], uint8_t (tool_index)); // Special commands T?/Tx/Tc
74
74
return ;
75
75
}
Original file line number Diff line number Diff line change 32
32
*/
33
33
void GcodeSuite::M117 () {
34
34
35
- if (parser.string_arg && parser. string_arg [ 0 ] )
35
+ if (parser.has_string () )
36
36
ui.set_status_no_expire (parser.string_arg );
37
37
else
38
38
ui.reset_status ();
Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ class GCodeParser {
97
97
FORCE_INLINE static void cancel_motion_mode () { motion_mode_codenum = -1 ; }
98
98
#endif
99
99
100
+ FORCE_INLINE static bool has_string () { return string_arg && string_arg[0 ]; }
101
+
100
102
#if ENABLED(DEBUG_GCODE_PARSER)
101
103
static void debug ();
102
104
#endif
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ void GcodeSuite::M75() {
43
43
startOrResumeJob (); // ... ExtUI::onPrintTimerStarted()
44
44
#if ENABLED(DWIN_LCD_PROUI)
45
45
// TODO: Remove if M75 <string> is never used
46
- if (!IS_SD_PRINTING ()) dwinPrintHeader (parser.string_arg && parser. string_arg [ 0 ] ? parser.string_arg : GET_TEXT (MSG_HOST_START_PRINT));
46
+ if (!IS_SD_PRINTING ()) dwinPrintHeader (parser.has_string () ? parser.string_arg : GET_TEXT (MSG_HOST_START_PRINT));
47
47
#endif
48
48
}
49
49
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ void RTS::onStartup() {
100
100
delay_ms (400 ); // Delay to allow screen to configure
101
101
102
102
#if ENABLED(CONFIGURABLE_MACHINE_NAME)
103
- const MString<32 > ready (message_string , " Ready" );
103
+ const MString<32 > ready (machine_name , " Ready" );
104
104
onStatusChanged (ready);
105
105
#else
106
106
onStatusChanged (F (MACHINE_NAME " Ready" ));
You canβt perform that action at this time.
0 commit comments