Prusa MINI Firmware overview
|
#include <gcode.h>
◆ axis_is_relative()
◆ set_relative_mode()
static void GcodeSuite::set_relative_mode |
( |
const bool |
rel | ) |
|
|
static |
◆ set_e_relative()
static void GcodeSuite::set_e_relative |
( |
| ) |
|
|
static |
◆ set_e_absolute()
static void GcodeSuite::set_e_absolute |
( |
| ) |
|
|
static |
◆ reset_stepper_timeout()
◆ get_target_extruder_from_command()
int8_t GcodeSuite::get_target_extruder_from_command |
( |
| ) |
|
|
static |
Get the target extruder from the T parameter or the active_extruder Return -1 if the T parameter is out of range
81 const int8_t e =
parser.value_byte();
◆ get_target_e_stepper_from_command()
int8_t GcodeSuite::get_target_e_stepper_from_command |
( |
| ) |
|
|
static |
Get the target e stepper from the T parameter Return -1 if the T parameter is out of range or unspecified
96 const int8_t e =
parser.intval(
'T', -1);
◆ get_destination_from_command()
void GcodeSuite::get_destination_from_command |
( |
| ) |
|
|
static |
Set XYZE destination and feedrate from the current GCode command
- Set destination from included axis codes
- Set to current for missing axis codes
- Set the feedrate, if included
126 #if ENABLED(POWER_LOSS_RECOVERY) && !PIN_EXISTS(POWER_LOSS)
132 if (
parser.linearval(
'F') > 0)
135 #if ENABLED(PRINTCOUNTER)
141 #if BOTH(MIXING_EXTRUDER, DIRECT_MIXING_IN_G1)
◆ process_parsed_command()
void GcodeSuite::process_parsed_command |
( |
const bool |
no_ok = false | ) |
|
|
static |
When G29_RETRY_AND_RECOVER is enabled, call G29() in a loop with recovery and retry handling. Process the parsed command and dispatch it to its handler
199 switch (
parser.command_letter) {
200 case 'G':
switch (
parser.codenum) {
202 case 0:
case 1: G0_G1(
203 #
if IS_SCARA || defined(G0_FEEDRATE)
209 #if ENABLED(ARC_SUPPORT) && DISABLED(SCARA)
210 case 2:
case 3: G2_G3(
parser.codenum == 2);
break;
215 #if ENABLED(BEZIER_CURVE_SUPPORT)
219 #if ENABLED(FWRETRACT)
220 case 10: G10();
break;
221 case 11: G11();
break;
224 #if ENABLED(NOZZLE_CLEAN_FEATURE)
225 case 12: G12();
break;
228 #if ENABLED(CNC_WORKSPACE_PLANES)
229 case 17: G17();
break;
230 case 18: G18();
break;
231 case 19: G19();
break;
234 #if ENABLED(INCH_MODE_SUPPORT)
235 case 20: G20();
break;
236 case 21: G21();
break;
238 case 21:
NOOP;
break;
241 #if ENABLED(G26_MESH_VALIDATION)
242 case 26: G26();
break;
245 #if ENABLED(NOZZLE_PARK_FEATURE)
246 case 27: G27();
break;
249 case 28: G28(
false);
break;
253 #if ENABLED(G29_RETRY_AND_RECOVER)
259 #endif // HAS_LEVELING
262 case 30: G30();
break;
263 #if ENABLED(Z_PROBE_SLED)
264 case 31: G31();
break;
265 case 32: G32();
break;
269 #if ENABLED(DELTA_AUTO_CALIBRATION)
270 case 33: G33();
break;
273 #if ENABLED(Z_STEPPER_AUTO_ALIGN)
274 case 34: G34();
break;
277 #if ENABLED(G38_PROBE_TARGET)
289 #if ENABLED(CNC_COORDINATE_SYSTEMS)
290 case 53: G53();
break;
291 case 54: G54();
break;
292 case 55: G55();
break;
293 case 56: G56();
break;
294 case 57: G57();
break;
295 case 58: G58();
break;
296 case 59: G59();
break;
299 #if ENABLED(GCODE_MOTION_MODES)
300 case 80: G80();
break;
306 case 92: G92();
break;
309 case 42: G42();
break;
312 #if ENABLED(CALIBRATION_GCODE)
313 case 425: G425();
break;
316 #if ENABLED(DEBUG_GCODE_PARSER)
317 case 800:
parser.debug();
break;
320 default:
parser.unknown_command_error();
break;
324 case 'M':
switch (
parser.codenum) {
325 #if HAS_RESUME_CONTINUE
327 case 1: M0_M1();
break;
331 case 3: M3_M4(
false);
break;
332 case 4: M3_M4(
true );
break;
336 #if ENABLED(COOLANT_CONTROL)
337 #if ENABLED(COOLANT_MIST)
340 #if ENABLED(COOLANT_FLOOD)
346 #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER)
347 case 12: M12();
break;
350 #if ENABLED(EXPECTED_PRINTER_CHECK)
351 case 16: M16();
break;
354 case 17: M17();
break;
356 #if ENABLED(SDSUPPORT)
357 case 20: M20();
break;
358 case 21: M21();
break;
359 case 22: M22();
break;
360 case 23: M23();
break;
361 case 24: M24();
break;
362 case 25: M25();
break;
363 case 26: M26();
break;
364 case 27: M27();
break;
365 case 28: M28();
break;
366 case 29: M29();
break;
367 case 30: M30();
break;
368 case 32: M32();
break;
370 #if ENABLED(LONG_FILENAME_HOST_SUPPORT)
371 case 33: M33();
break;
374 #if BOTH(SDCARD_SORT_ALPHA, SDSORT_GCODE)
375 case 34: M34();
break;
378 case 928: M928();
break;
381 case 31: M31();
break;
382 case 42: M42();
break;
384 #if ENABLED(PINS_DEBUGGING)
385 case 43: M43();
break;
388 #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
389 case 48: M48();
break;
392 #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
393 case 73: M73();
break;
396 #if ENABLED(M73_PRUSA)
397 case 73: M73_PE();
break;
400 case 75: M75();
break;
401 case 76: M76();
break;
402 case 77: M77();
break;
404 #if ENABLED(PRINTCOUNTER)
405 case 78: M78();
break;
408 #if ENABLED(M100_FREE_MEMORY_WATCHER)
409 case 100: M100();
break;
413 case 104: M104();
break;
414 case 109: M109();
break;
417 case 105: M105();
return;
420 case 106: M106();
break;
421 case 107: M107();
break;
424 case 110: M110();
break;
425 case 111: M111();
break;
427 #if DISABLED(EMERGENCY_PARSER)
428 case 108: M108();
break;
429 case 112: M112();
break;
430 case 410: M410();
break;
431 #if ENABLED(HOST_PROMPT_SUPPORT)
432 case 876: M876();
break;
435 case 108:
case 112:
case 410:
436 #if ENABLED(HOST_PROMPT_SUPPORT)
442 #if ENABLED(HOST_KEEPALIVE_FEATURE)
443 case 113: M113();
break;
447 case 140: M140();
break;
448 case 190: M190();
break;
451 #if HAS_HEATED_CHAMBER
452 case 141: M141();
break;
453 case 191: M191();
break;
456 #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR
457 case 155: M155();
break;
460 #if ENABLED(PARK_HEAD_ON_PAUSE)
461 case 125: M125();
break;
464 #if ENABLED(BARICUDA)
467 case 126: M126();
break;
468 case 127: M127();
break;
473 case 128: M128();
break;
474 case 129: M129();
break;
479 case 80: M80();
break;
481 case 81: M81();
break;
483 case 82: M82();
break;
484 case 83: M83();
break;
485 case 18:
case 84: M18_M84();
break;
486 case 85: M85();
break;
487 case 86: M86();
break;
488 case 92: M92();
break;
489 case 114: M114();
break;
490 case 115: M115();
break;
491 case 117: M117();
break;
492 case 118: M118();
break;
493 case 119: M119();
break;
494 case 120: M120();
break;
495 case 121: M121();
break;
497 #if HOTENDS && HAS_LCD_MENU
498 case 145: M145();
break;
501 #if ENABLED(TEMPERATURE_UNITS_SUPPORT)
502 case 149: M149();
break;
506 case 150: M150();
break;
509 #if ENABLED(MIXING_EXTRUDER)
510 case 163: M163();
break;
511 case 164: M164();
break;
512 #if ENABLED(DIRECT_MIXING_IN_G1)
513 case 165: M165();
break;
515 #if ENABLED(GRADIENT_MIX)
516 case 166: M166();
break;
520 #if DISABLED(NO_VOLUMETRICS)
521 case 200: M200();
break;
524 case 201: M201();
break;
527 case 202: M202();
break;
530 case 203: M203();
break;
531 case 204: M204();
break;
532 case 205: M205();
break;
535 case 206: M206();
break;
539 case 665: M665();
break;
542 #if ANY(DELTA, X_DUAL_ENDSTOPS, Y_DUAL_ENDSTOPS, Z_DUAL_ENDSTOPS)
543 case 666: M666();
break;
546 #if ENABLED(FWRETRACT)
547 case 207: M207();
break;
548 case 208: M208();
break;
549 #if ENABLED(FWRETRACT_AUTORETRACT)
551 if (MIN_AUTORETRACT <= MAX_AUTORETRACT) M209();
556 #if HAS_SOFTWARE_ENDSTOPS
557 case 211: M211();
break;
561 case 217: M217();
break;
564 #if HAS_HOTEND_OFFSET
565 case 218: M218();
break;
568 case 220: M220();
break;
571 case 221: M221();
break;
574 case 226: M226();
break;
577 case 280: M280();
break;
578 #if ENABLED(EDITABLE_SERVO_ANGLES)
579 case 281: M281();
break;
583 #if ENABLED(BABYSTEPPING)
584 case 290: M290();
break;
588 case 300: M300();
break;
592 case 301: M301();
break;
595 #if ENABLED(PIDTEMPBED)
596 case 304: M304();
break;
599 #if ENABLED(PHOTO_GCODE)
600 case 240: M240();
break;
604 case 250: M250();
break;
607 #if ENABLED(EXPERIMENTAL_I2CBUS)
608 case 260: M260();
break;
609 case 261: M261();
break;
612 #if ENABLED(PREVENT_COLD_EXTRUSION)
613 case 302: M302();
break;
617 case 303: M303();
break;
620 #if HAS_USER_THERMISTORS
621 case 305: M305();
break;
624 #if ENABLED(MORGAN_SCARA)
625 case 360:
if (M360())
return;
break;
626 case 361:
if (M361())
return;
break;
627 case 362:
if (M362())
return;
break;
628 case 363:
if (M363())
return;
break;
629 case 364:
if (M364())
return;
break;
632 #if EITHER(EXT_SOLENOID, MANUAL_SOLENOID_CONTROL)
633 case 380: M380();
break;
634 case 381: M381();
break;
637 case 400: M400();
break;
640 case 401: M401();
break;
641 case 402: M402();
break;
644 #if ENABLED(PRUSA_MMU2)
645 case 403: M403();
break;
648 #if ENABLED(FILAMENT_WIDTH_SENSOR)
649 case 404: M404();
break;
650 case 405: M405();
break;
651 case 406: M406();
break;
652 case 407: M407();
break;
655 #if HAS_FILAMENT_SENSOR
656 case 412: M412();
break;
660 case 420: M420();
break;
664 case 421: M421();
break;
667 #if ENABLED(BACKLASH_GCODE)
668 case 425: M425();
break;
672 case 428: M428();
break;
675 case 500: M500();
break;
676 case 501: M501();
break;
677 case 502: M502();
break;
678 #if DISABLED(DISABLE_M503)
679 case 503: M503();
break;
681 #if ENABLED(EEPROM_SETTINGS)
682 case 504: M504();
break;
685 #if ENABLED(SDSUPPORT)
686 case 524: M524();
break;
689 #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT)
690 case 540: M540();
break;
693 #if ENABLED(BAUD_RATE_GCODE)
694 case 575: M575();
break;
698 case 851: M851();
break;
701 #if ENABLED(SKEW_CORRECTION_GCODE)
702 case 852: M852();
break;
705 #if ENABLED(ADVANCED_PAUSE_FEATURE)
706 case 600: M600();
break;
707 case 603: M603();
break;
710 #if HAS_DUPLICATION_MODE
711 case 605: M605();
break;
714 #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
715 case 701: M701();
break;
716 case 702: M702();
break;
719 #if ENABLED(MAX7219_GCODE)
720 case 7219: M7219();
break;
723 #if ENABLED(GCODE_MACROS)
724 case 810:
case 811:
case 812:
case 813:
case 814:
725 case 815:
case 816:
case 817:
case 818:
case 819:
729 #if ENABLED(LIN_ADVANCE)
730 case 900: M900();
break;
733 #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || EITHER(DIGIPOT_I2C, DAC_STEPPER_CURRENT)
734 case 907: M907();
break;
735 #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT)
736 case 908: M908();
break;
737 #if ENABLED(DAC_STEPPER_CURRENT)
738 case 909: M909();
break;
739 case 910: M910();
break;
745 case 122: M122();
break;
746 case 906: M906();
break;
748 case 569: M569();
break;
750 #if ENABLED(MONITOR_DRIVER_STATUS)
751 case 911: M911();
break;
752 case 912: M912();
break;
754 #if ENABLED(HYBRID_THRESHOLD)
755 case 913: M913();
break;
758 case 914: M914();
break;
762 #if HAS_DRIVER(L6470)
763 case 122: M122();
break;
764 case 906: M906();
break;
765 case 916: M916();
break;
766 case 917: M917();
break;
767 case 918: M918();
break;
771 case 350: M350();
break;
772 case 351: M351();
break;
776 case 355: M355();
break;
779 #if ENABLED(DEBUG_GCODE_PARSER)
780 case 800:
parser.debug();
break;
783 #if ENABLED(I2C_POSITION_ENCODERS)
784 case 860: M860();
break;
785 case 861: M861();
break;
786 case 862: M862();
break;
787 case 863: M863();
break;
788 case 864: M864();
break;
789 case 865: M865();
break;
790 case 866: M866();
break;
791 case 867: M867();
break;
792 case 868: M868();
break;
793 case 869: M869();
break;
796 #if ENABLED(MAGNETIC_PARKING_EXTRUDER)
797 case 951: M951();
break;
800 #if ENABLED(Z_STEPPER_AUTO_ALIGN)
801 case 422: M422();
break;
804 #if ENABLED(PLATFORM_M997_SUPPORT)
805 case 997: M997();
break;
808 case 999: M999();
break;
810 #if ENABLED(POWER_LOSS_RECOVERY)
811 case 413: M413();
break;
812 case 1000: M1000();
break;
815 default:
parser.unknown_command_error();
break;
819 case 'T': T(
parser.codenum);
break;
821 default:
parser.unknown_command_error();
◆ process_next_command()
void GcodeSuite::process_next_command |
( |
| ) |
|
|
static |
Process a single command and dispatch it to its handler This is called from the main loop()
836 #if ENABLED(POWER_LOSS_RECOVERY)
843 #if ENABLED(M100_FREE_MEMORY_DUMPER)
850 parser.parse(current_command);
◆ process_subcommands_now_P()
void GcodeSuite::process_subcommands_now_P |
( |
PGM_P |
pgcode | ) |
|
|
static |
Run a series of commands, bypassing the command queue to allow G-code "macros" to be called from within other G-code handlers.
860 char *
const saved_cmd =
parser.command_ptr;
863 const size_t len = delim ? delim - pgcode :
strlen_P(pgcode);
◆ process_subcommands_now()
void GcodeSuite::process_subcommands_now |
( |
char * |
gcode | ) |
|
|
static |
876 char *
const saved_cmd =
parser.command_ptr;
878 char *
const delim = strchr(
gcode,
'\n');
879 if (delim) *delim =
'\0';
◆ home_all_axes()
static void GcodeSuite::home_all_axes |
( |
| ) |
|
|
static |
◆ dwell()
Dwell waits immediately. It does not synchronize. Use M400 instead of G4
◆ axis_relative
◆ previous_move_ms
#define WITHIN(N, L, H)
Definition: macros.h:195
#define PENDING(NOW, SOON)
Definition: millis_t.h:28
#define SERIAL_CHAR(x)
Definition: serial.h:69
#define PORT_REDIRECT(p)
Definition: serial.h:66
u16_t len
Definition: pbuf.h:159
#define SERIAL_ECHO(x)
Definition: serial.h:70
static void process_subcommands_now_P(PGM_P pgcode)
Definition: gcode.cpp:859
static void process_parsed_command(const bool no_ok=false)
Definition: gcode.cpp:195
const char * strchr_P(const char *s, int c)
Definition: Marduino.h:57
static void ok_to_send()
Definition: queue.cpp:242
GCodeQueue queue
Definition: queue.cpp:28
#define IS_SD_PRINTING()
Definition: cardreader.h:295
Stopwatch print_job_timer
Definition: printcounter.cpp:63
#define SERIAL_ECHOPAIR(V...)
Definition: serial.h:114
#define PGM_P
Definition: pgmspace.h:30
T e
Definition: types.h:383
uint8_t i
Definition: screen_test_graph.c:72
static millis_t previous_move_ms
Definition: gcode.h:329
AxisEnum
Definition: types.h:36
xyze_pos_t destination
Definition: motion.cpp:110
uint32_t millis(void)
Definition: wiring_time.c:29
static uint8_t queue_index_r
Queue index of the active command.
Definition: power_loss_recovery.h:113
PrintJobRecovery recovery
#define SERIAL_ECHO_START()
Definition: serial.h:179
#define SERIAL_ECHOLN(x)
Definition: serial.h:72
#define KEEPALIVE_STATE(N)
Definition: gcode.h:365
#define strlen_P(s)
Definition: pgmspace.h:61
#define MSG_INVALID_E_STEPPER
Definition: language.h:168
static char command_buffer[BUFSIZE][MAX_CMD_SIZE]
Definition: queue.h:54
#define PSTR(str)
Definition: pgmspace.h:31
xyze_pos_t current_position
Definition: motion.cpp:102
static constexpr xyze_bool_t ar_init
Definition: gcode.cpp:53
#define LOGICAL_TO_NATIVE(POS, AXIS)
Definition: motion.h:270
static uint8_t index_r
Definition: queue.h:51
GcodeSuite gcode
Definition: gcode.cpp:29
static bool axis_is_relative(const AxisEnum a)
Definition: gcode.h:294
T x
Definition: types.h:383
feedRate_t feedrate_mm_s
Definition: motion.cpp:138
#define SERIAL_ECHOLNPAIR(V...)
Definition: serial.h:144
list a
Definition: createSpeedLookupTable.py:29
static void set_relative_mode(const bool rel)
Definition: gcode.h:301
#define _BV(bit)
Definition: wiring_constants.h:99
#define E_STEPPERS
Definition: Conditionals_LCD.h:429
#define IS_SCARA
Definition: Conditionals_LCD.h:544
#define CBI(A, B)
Definition: macros.h:89
static void save(const bool force=false, const bool save_queue=true)
#define EXTRUDERS
Definition: Configuration_A3ides_2209_MINI.h:148
#define DEBUGGING(F)
Definition: serial.h:47
#define strncpy_P(a, b, n)
Definition: pgmspace.h:66
#define TEST(n, b)
Definition: macros.h:81
static uint8_t axis_relative
Definition: gcode.h:292
#define NOOP
Definition: macros.h:258
#define SBI(A, B)
Definition: macros.h:85
const xyze_char_t axis_codes
Definition: types.h:486
#define SERIAL_ECHOLNPGM(S)
Definition: serial.h:174
#define LOOP_XYZE(VAR)
Definition: types.h:61
void idle()
Definition: Marlin.cpp:629
#define MSG_E_STEPPER_NOT_SPECIFIED
Definition: language.h:169
static bool enabled
Definition: power_loss_recovery.h:138
#define MSG_INVALID_EXTRUDER
Definition: language.h:167
constexpr uint8_t active_extruder
Definition: motion.h:107
#define ENABLED(V...)
Definition: macros.h:177
T y
Definition: types.h:383
parser
Definition: createSpeedLookupTable.py:14