* Enqueue from program memory and return only when commands are actually enqueued * Never call this from a G-code handler! */
| 214 | * Never call this from a G-code handler! |
| 215 | */ |
| 216 | void GCodeQueue::enqueue_now_P(PGM_P const pgcode) { |
| 217 | size_t i = 0; |
| 218 | PGM_P p = pgcode; |
| 219 | for (;;) { |
| 220 | char c; |
| 221 | while ((c = pgm_read_byte(&p[i])) && c != '\n') i++; |
| 222 | char cmd[i + 1]; |
| 223 | memcpy_P(cmd, p, i); |
| 224 | cmd[i] = '\0'; |
| 225 | enqueue_one_now(cmd); |
| 226 | if (!c) break; |
| 227 | p += i + 1; |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * Send an "ok" message to the host, indicating |
no outgoing calls
no test coverage detected