* Process the next "immediate" command from PROGMEM. * Return 'true' if any commands were processed. */
| 139 | * Return 'true' if any commands were processed. |
| 140 | */ |
| 141 | bool 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. |
nothing calls this directly
no test coverage detected