MCPcopy Create free account
hub / github.com/MarlinFirmware/Marlin / process_injected_command_P

Method process_injected_command_P

Marlin/src/gcode/queue.cpp:141–160  ·  view source on GitHub ↗

* Process the next "immediate" command from PROGMEM. * Return 'true' if any commands were processed. */

Source from the content-addressed store, hash-verified

139 * Return 'true' if any commands were processed.
140 */
141bool GCodeQueue::process_injected_command_P() {
142 if (!injected_commands_P) return false;
143
144 char c;
145 size_t i = 0;
146 while ((c = pgm_read_byte(&injected_commands_P[i])) && c != '\n') i++;
147
148 // Extract current command and move pointer to next command
149 char cmd[i + 1];
150 memcpy_P(cmd, injected_commands_P, i);
151 cmd[i] = '\0';
152 injected_commands_P = c ? injected_commands_P + i + 1 : nullptr;
153
154 // Execute command if non-blank
155 if (i) {
156 parser.parse(cmd);
157 gcode.process_parsed_command();
158 }
159 return true;
160}
161
162/**
163 * Process the next "immediate" command from SRAM.

Callers

nothing calls this directly

Calls 2

parseMethod · 0.45

Tested by

no test coverage detected