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

Method process_next_command

Marlin/src/gcode/gcode.cpp:1190–1209  ·  view source on GitHub ↗

* Process a single command and dispatch it to its handler * This is called from the main loop() */

Source from the content-addressed store, hash-verified

1188 * This is called from the main loop()
1189 */
1190void 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

Callers 1

advanceMethod · 0.80

Calls 5

SERIAL_ECHO_STARTFunction · 0.85
M100_dump_routineFunction · 0.85
SERIAL_ECHOLNFunction · 0.50
FFunction · 0.50
parseMethod · 0.45

Tested by

no test coverage detected