🎨 Apply F() to G-code subcommands

This commit is contained in:
Scott Lahteine
2021-09-25 18:43:52 -05:00
committed by Scott Lahteine
parent 433a27e475
commit 2b9ae0cc33
28 changed files with 136 additions and 134 deletions

View File

@@ -243,7 +243,7 @@ void GcodeSuite::dwell(millis_t time) {
host_action(PSTR(ACTION_ON_G29_RECOVER));
#endif
#ifdef G29_RECOVER_COMMANDS
process_subcommands_now_P(PSTR(G29_RECOVER_COMMANDS));
process_subcommands_now(F(G29_RECOVER_COMMANDS));
#endif
}
@@ -256,7 +256,7 @@ void GcodeSuite::dwell(millis_t time) {
host_action(PSTR(ACTION_ON_G29_FAILURE));
#endif
#ifdef G29_FAILURE_COMMANDS
process_subcommands_now_P(PSTR(G29_FAILURE_COMMANDS));
process_subcommands_now(F(G29_FAILURE_COMMANDS));
#endif
#if ENABLED(G29_HALT_ON_FAILURE)
#ifdef ACTION_ON_CANCEL
@@ -286,7 +286,7 @@ void GcodeSuite::dwell(millis_t time) {
TERN_(HOST_PROMPT_SUPPORT, host_action_prompt_end());
#ifdef G29_SUCCESS_COMMANDS
process_subcommands_now_P(PSTR(G29_SUCCESS_COMMANDS));
process_subcommands_now(F(G29_SUCCESS_COMMANDS));
#endif
}
@@ -1101,7 +1101,8 @@ void GcodeSuite::process_next_command() {
* G-code "macros" to be called from within other G-code handlers.
*/
void GcodeSuite::process_subcommands_now_P(PGM_P pgcode) {
void GcodeSuite::process_subcommands_now(FSTR_P fgcode) {
PGM_P pgcode = FTOP(fgcode);
char * const saved_cmd = parser.command_ptr; // Save the parser state
for (;;) {
PGM_P const delim = strchr_P(pgcode, '\n'); // Get address of next newline