* Process a single command and dispatch it to its handler * This is called from the main loop() */
| 1188 | * This is called from the main loop() |
| 1189 | */ |
| 1190 | void GcodeSuite::process_next_command() { |
| 1191 | GCodeQueue::CommandLine &command = queue.ring_buffer.peek_next_command(); |
| 1192 | |
| 1193 | PORT_REDIRECT(SERIAL_PORTMASK(command.port)); |
| 1194 | |
| 1195 | TERN_(POWER_LOSS_RECOVERY, recovery.queue_index_r = queue.ring_buffer.index_r); |
| 1196 | |
| 1197 | if (DEBUGGING(ECHO)) { |
| 1198 | SERIAL_ECHO_START(); |
| 1199 | SERIAL_ECHOLN(command.buffer); |
| 1200 | #if ENABLED(M100_FREE_MEMORY_DUMPER) |
| 1201 | SERIAL_ECHOPGM("slot:", queue.ring_buffer.index_r); |
| 1202 | M100_dump_routine(F(" Command Queue:"), (const char*)&queue.ring_buffer, sizeof(queue.ring_buffer)); |
| 1203 | #endif |
| 1204 | } |
| 1205 | |
| 1206 | // Parse the next command in the queue |
| 1207 | parser.parse(command.buffer); |
| 1208 | process_parsed_command(); |
| 1209 | } |
| 1210 | |
| 1211 | #pragma GCC diagnostic push |
| 1212 | #if GCC_VERSION >= 80000 |
no test coverage detected