/*
* -----------------------------------------------------------------
* Gcode command processor
* Implemented Codes
* look here for descriptions of gcodes:
*
http://linuxcnc.org/handbook/gcode/g-code.html
*
http://objects.reprap.org/wiki/Mendel_U ... pRapGCodes
* -----------------------------------------------------------------
* G0 -> G1
* G1 - Coordinated Movement X Y Z E
* G2 - CW ARC
* G3 - CCW ARC
* G4 - Dwell S<seconds> or P<milliseconds>
* G10 - retract filament according to setting of M207
* G11 - retract recover according to setting of M208
* G28 - Home all Axis
* G90 - Use Absolute Coordinates
* G91 - Use Relative Coordinates
* G92 - Set current position to coordinates given
*
* RepRap M Codes
* M104 - Set extruder target temp
* M105 - Read current temp
* M106 - Fan 1 on
* M107 - Fan 1 off
* M109 - Wait for extruder current temp to reach target temp.
* M114 - Display current position
*
* Custom M Codes
* M20 - List SD card
* M21 - Init SD card
* M22 - Release SD card
* M23 - Select SD file (M23 filename.g)
* M24 - Start/resume SD print
* M25 - Pause SD print
* M26 - Set SD position in bytes (M26 S12345)
* M27 - Report SD print status
* M28 - Start SD write (M28 filename.g)
* M29 - Stop SD write
* <filename> - Delete file on sd card
* M42 - Set output on free pins (not implemented)
* M44 - Boot From ROM (load bootloader for uploading firmware)
* M80 - Turn on Power Supply (not implemented)
* M81 - Turn off Power Supply (not implemented)
* M82 - Set E codes absolute (default)
* M83 - Set E codes relative while in Absolute Coordinates (G90) mode
* M84 - Disable steppers until next move,
* or use S<seconds> to specify an inactivity timeout,
* after which the steppers will be disabled. S0 to disable the timeout.
* M85 - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
* M92 - Set axis_steps_per_unit - same syntax as G92
* M93 - Send axis_steps_per_unit
* M115 - Capabilities string
* M119 - Show Endstop State
* M140 - Set bed target temp
* M176 - Fan 2 on
* M177 - Fan 2 off
* M190 - Wait for bed current temp to reach target temp.
* M201 - Set maximum acceleration in units/s^2 for print moves (M201 X1000 Y1000)
* M202 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
* M203 - Set temperture monitor to Sx
* M204 - Set default acceleration: S normal moves T filament only moves
* (M204 S3000 T7000) in mm/sec^2
* M205 - advanced settings: minimum travel speed S=while printing T=travel only,
* X=maximum xy jerk, Z=maximum Z jerk
* M206 - set additional homing offset
* M207 - set homing feedrate mm/min (M207 X1500 Y1500 Z120)
*
* M220 - set speed factor override percentage S=factor in percent
* M221 - set extruder multiply factor S100 --> original Extrude Speed
*
* Note: M301, M303, M304 applies to currently selected extruder. Use T0 or T1 to select.
* M301 - Set Heater parameters P, I, D, S (slope), B (y-intercept), W (maximum pwm)
* M303 - PID relay autotune S<temperature> sets the target temperature.
* (default target temperature = 150C)
* M304 - Calculate slope and y-intercept for HEATER_DUTY_FOR_SETPOINT formula.
* Caution - this can take 30 minutes to complete and will heat the hotend
* to 200 degrees.
*
* M400 - Finish all moves
*
* M510 - Invert axis, 0=false, 1=true (M510 X0 Y0 Z0 E1)
* M520 - Set maximum print area (M520 X200 Y200 Z150)
* M521 - Disable axis when unused (M520 X0 Y0 Z1 E0)
* M522 - Use software endstops I=min, A=max, 0=false, 1=true (M522 I0 A1)
* M523 - Enable min endstop input 1=true, -1=false (M523 X1 Y1 Z1)
* M524 - Enable max endstop input 1=true, -1=false (M524 X-1 Y-1 Z-1)
* M525 - Set homing direction 1=+, -1=- (M525 X-1 Y-1 Z-1)
* M526 - Invert endstop inputs 0=false, 1=true (M526 X0 Y0 Z0)
*
* Note: M530, M531 applies to currently selected extruder. Use T0 or T1 to select.
* M530 - Set heater sensor (thermocouple) type B (bed) E (extruder) (M530 E11 B11)
* M531 - Set heater PWM mode 0=false, 1=true (M531 E1)
*
* M350 - Set microstepping steps (M350 X16 Y16 Z16 E16 B16)
* M906 - Set motor current (mA) (M906 X1000 Y1000 Z1000 E1000 B1000) or set all (M906 S1000)
* M907 - Set motor current (raw) (M907 X128 Y128 Z128 E128 B128) or set all (M907 S128)
*
* M500 - stores paramters in EEPROM
* M501 - reads parameters from EEPROM
* (if you need to reset them after you changed them temporarily).
* M502 - reverts to the default "factory settings".
* You still need to store them in EEPROM afterwards if you want to.
* M503 - Print settings
* M505 - Save Parameters to SD-Card
*/