diff --git a/Firmware/Dcodes.cpp b/Firmware/Dcodes.cpp
index d2016ded..0a514262 100644
--- a/Firmware/Dcodes.cpp
+++ b/Firmware/Dcodes.cpp
@@ -99,6 +99,18 @@ void print_mem(uint32_t address, uint16_t count, uint8_t type, uint8_t countperl
#ifdef DEBUG_DCODE3
#define EEPROM_SIZE 0x1000
+ /*!
+ *
+ ### D3 - Read/Write EEPROM D3: Read/Write EEPROM
+ This command can be used without any additional parameters. It will read the entire eeprom.
+
+ D3 [ A | C | X ]
+
+ - `A` - Address (0x0000-0x0fff)
+ - `C` - Count (0x0001-0x1000)
+ - `X` - Data
+ *
+ */
void dcode_3()
{
DBG(_N("D3 - Read/Write EEPROM\n"));
@@ -176,6 +188,14 @@ extern float axis_steps_per_unit[NUM_AXIS];
#endif //0
#define LOG(args...)
+ /*!
+ *
+ ### D-1 - Endless Loop D-1: Endless Loop
+
+ D-1
+
+ *
+ */
void dcode__1()
{
printf_P(PSTR("D-1 - Endless loop\n"));
@@ -185,6 +205,15 @@ void dcode__1()
#ifdef DEBUG_DCODES
+ /*!
+ *
+ ### D0 - Reset D0: Reset
+
+ D0 [ B ]
+
+ - `B` - Bootloader
+ *
+ */
void dcode_0()
{
if (*(strchr_pointer + 1) == 0) return;
@@ -203,6 +232,14 @@ void dcode_0()
}
}
+ /*!
+ *
+ ### D1 - Clear EEPROM and RESET D1: Clear EEPROM and RESET
+
+ D1
+
+ *
+ */
void dcode_1()
{
LOG("D1 - Clear EEPROM and RESET\n");
@@ -213,6 +250,18 @@ void dcode_1()
while(1);
}
+ /*!
+ *
+ ### D2 - Read/Write RAM D3: Read/Write RAM
+ This command can be used without any additional parameters. It will read the entire RAM.
+
+ D3 [ A | C | X ]
+
+ - `A` - Address (0x0000-0x1fff)
+ - `C` - Count (0x0001-0x2000)
+ - `X` - Data
+ *
+ */
void dcode_2()
{
LOG("D2 - Read/Write RAM\n");
@@ -256,6 +305,19 @@ void dcode_2()
}*/
}
+ /*!
+ *
+ ### D4 - Read/Write PIN D4: Read/Write PIN
+
+ To read the digital value of a pin you need only to define the pin number.
+
+ D4 [ P | F | V ]
+
+ - `P` - Pin (0-255)
+ - `F` - Function in/out (0/1)
+ - `V` - Value (0/1)
+ *
+ */
void dcode_4()
{
LOG("D4 - Read/Write PIN\n");
@@ -288,6 +350,19 @@ void dcode_4()
#ifdef DEBUG_DCODE5
+ /*!
+ *
+ ### D5 - Read/Write FLASH D5: Read/Write Flash
+ This command can be used without any additional parameters. It will read the 1kb FLASH.
+
+ D3 [ A | C | X | E ]
+
+ - `A` - Address (0x00000-0x3ffff)
+ - `C` - Count (0x0001-0x2000)
+ - `X` - Data
+ - `E` - Erase
+ *
+ */
void dcode_5()
{
printf_P(PSTR("D5 - Read/Write FLASH\n"));
@@ -351,11 +426,25 @@ void dcode_5()
#ifdef DEBUG_DCODES
+ /*!
+ *
+ ### D6 - Read/Write external FLASH D6: Read/Write external Flash
+
+ Reserved
+ *
+ */
void dcode_6()
{
LOG("D6 - Read/Write external FLASH\n");
}
+ /*!
+ *
+ ### D7 - Read/Write Bootloader D7: Read/Write Bootloader
+
+ Reserved
+ *
+ */
void dcode_7()
{
LOG("D7 - Read/Write Bootloader\n");
@@ -371,6 +460,18 @@ void dcode_7()
*/
}
+ /*!
+ *
+ ### D8 - Read/Write PINDA D8: Read/Write PINDA
+
+ D8 [ ? | ! | P | Z ]
+
+ - `?` - Read PINDA temperature shift values
+ - `!` - Reset PINDA temperature shift values to default
+ - `P` - Pinda temperature [C]
+ - `Z` - Z Offset [mm]
+ *
+ */
void dcode_8()
{
printf_P(PSTR("D8 - Read/Write PINDA\n"));
@@ -412,6 +513,23 @@ void dcode_8()
printf_P(PSTR("temp_pinda=%d offset_z=%d.%03d\n"), (int)temp_pinda, (int)offset_z, ((int)(1000 * offset_z) % 1000));
}
+ /*!
+ *
+ ### D9 - Read ADC D9: Read ADC
+
+ D9 [ I | V ]
+
+ - `I` - ADC channel index
+ - `0` - Heater 0 temperature
+ - `1` - Heater 1 temperature
+ - `2` - Bed temperature
+ - `3` - PINDA temperature
+ - `4` - PWR voltage
+ - `5` - Ambient temperature
+ - `6` - BED voltage
+ - `V` Value to be written as simulated
+ *
+ */
const char* dcode_9_ADC_name(uint8_t i)
{
switch (i)
@@ -485,12 +603,24 @@ void dcode_9()
}
}
+ /*!
+ *
+ ### D10 - Set XYZ calibration = OK D10: Set XYZ calibration = OK
+
+ *
+ */
void dcode_10()
{//Tell the printer that XYZ calibration went OK
LOG("D10 - XYZ calibration = OK\n");
calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST);
}
+ /*!
+ *
+ ### D12 - Time D12: Time
+
+ *
+ */
void dcode_12()
{//Time
LOG("D12 - Time\n");
@@ -636,6 +766,20 @@ void dcode_2130()
#endif //TMC2130
#ifdef PAT9125
+ /*!
+ *
+ ### D9125 - PAT9125 filament sensor D9125: PAT9125 filament sensor
+
+ D9125 [ ? | ! | R | X | Y | L ]
+
+ - `?` - Print values
+ - `!` - Print values
+ - `R` - Resolution. Not active in code
+ - `X` - X values
+ - `Y` - Y values
+ - `L` - Activate filament sensor log
+ *
+ */
void dcode_9125()
{
LOG("D9125 - PAT9125\n");
diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp
index 57b8e4ba..211384f9 100755
--- a/Firmware/Marlin_main.cpp
+++ b/Firmware/Marlin_main.cpp
@@ -3410,8 +3410,7 @@ extern uint8_t st_backlash_y;
//! @brief Parse and process commands
//!
-//! look here for descriptions of G-codes: http://linuxcnc.org/handbook/gcode/g-code.html
-//! http://objects.reprap.org/wiki/Mendel_User_Manual:_RepRapGCodes
+//! look here for descriptions of G-codes: https://reprap.org/wiki/G-code
//!
//!
//! Implemented Codes
@@ -3430,7 +3429,7 @@ extern uint8_t st_backlash_y;
//!@n G4 - Dwell S or P
//!@n G10 - retract filament according to settings of M207
//!@n G11 - retract recover filament according to settings of M208
-//!@n G28 - Home all Axis
+//!@n G28 - Home all Axes
//!@n G29 - Detailed Z-Probe, probes the bed at 3 or more points. Will fail if you haven't homed yet.
//!@n G30 - Single Z Probe, probes bed at current XY location.
//!@n G31 - Dock sled (Z_PROBE_SLED only)
@@ -3547,7 +3546,11 @@ extern uint8_t st_backlash_y;
/** \ingroup GCodes */
-//! _This is a list of currently implemented G Codes in Prusa firmware (dynamically generated from doxygen)_
+//! _This is a list of currently implemented G Codes in Prusa firmware (dynamically generated from doxygen)._
+/**
+They are shown in order of appearance in the code.
+There are reasons why some G Codes aren't in numerical order.
+*/
void process_commands()
@@ -3591,7 +3594,25 @@ void process_commands()
float tmp_motor_loud[3] = DEFAULT_PWM_MOTOR_CURRENT_LOUD;
int8_t SilentMode;
#endif
+ /*!
+ ---------------------------------------------------------------------------------
+ ### M117 - Display Message M117: Display Message
+ This causes the given message to be shown in the status line on an attached LCD.
+ It is processed early as to allow printing messages that contain G, M, N or T.
+
+ ---------------------------------------------------------------------------------
+ ### Special internal commands
+ These are used by internal functions to process certain actions in the right order. Some of these are also usable by the user.
+ They are processed early as the commands are complex (strings).
+ These are only available on the MK3(S) as these require TMC2130 drivers:
+ - CRASH DETECTED
+ - CRASH RECOVER
+ - CRASH_CANCEL
+ - TMC_SET_WAVE
+ - TMC_SET_STEP
+ - TMC_SET_CHOP
+ */
if (code_seen("M117")) { //moved to highest priority place to be able to to print strings which includes "G", "PRUSA" and "^"
starpos = (strchr(strchr_pointer + 5, '*'));
if (starpos != NULL)
@@ -3603,7 +3624,7 @@ void process_commands()
else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("CRASH_"), 6) == 0)
{
- //! ### CRASH_DETECTED - TMC2130
+ // ### CRASH_DETECTED - TMC2130
// ---------------------------------
if(code_seen("CRASH_DETECTED"))
{
@@ -3613,12 +3634,12 @@ void process_commands()
crashdet_detected(mask);
}
- //! ### CRASH_RECOVER - TMC2130
+ // ### CRASH_RECOVER - TMC2130
// ----------------------------------
else if(code_seen("CRASH_RECOVER"))
crashdet_recover();
- //! ### CRASH_CANCEL - TMC2130
+ // ### CRASH_CANCEL - TMC2130
// ----------------------------------
else if(code_seen("CRASH_CANCEL"))
crashdet_cancel();
@@ -3626,7 +3647,7 @@ void process_commands()
else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("TMC_"), 4) == 0)
{
- //! ### TMC_SET_WAVE_
+ // ### TMC_SET_WAVE_
// --------------------
if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_WAVE_"), 9) == 0)
{
@@ -3639,7 +3660,7 @@ void process_commands()
}
}
- //! ### TMC_SET_STEP_
+ // ### TMC_SET_STEP_
// ------------------
else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_STEP_"), 9) == 0)
{
@@ -3653,7 +3674,7 @@ void process_commands()
}
}
- //! ### TMC_SET_CHOP_
+ // ### TMC_SET_CHOP_
// -------------------
else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_CHOP_"), 9) == 0)
{
@@ -3708,13 +3729,14 @@ void process_commands()
#endif //TMC2130
else if(code_seen("PRUSA")){
/*!
- *
- ### PRUSA - Internal command set
+ ---------------------------------------------------------------------------------
+ ### PRUSA - Internal command set G98: Activate farm mode - Notes
Set of internal PRUSA commands
-
- PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ]
-
+ #### Usage
+ PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ]
+
+ #### Parameters
- `Ping`
- `PRN` - Prints revision of the printer
- `FAN` - Prints fan details
@@ -3735,7 +3757,6 @@ void process_commands()
- `nozzle set ` - set nozzle diameter (farm mode only), e.g. `PRUSA nozzle set 0.4`
- `nozzle D` - check the nozzle diameter (farm mode only), works like M862.1 P, e.g. `PRUSA nozzle D0.4`
- `nozzle` - prints nozzle diameter (farm mode only), works like M862.1 P, e.g. `PRUSA nozzle`
- *
*/
@@ -3750,7 +3771,7 @@ void process_commands()
} else if( code_seen("FANPINTST") ){
gcode_PRUSA_BadRAMBoFanTest();
- }else if (code_seen("FAN")) { //! PRUSA FAN
+ }else if (code_seen("FAN")) { // PRUSA FAN
printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]);
}else if (code_seen("fn")) { // PRUSA fn
if (farm_mode) {
@@ -3919,8 +3940,24 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF);
switch (gcode_in_progress)
{
- //! ### G0, G1 - Coordinated movement X Y Z E
- // --------------------------------------
+ /*!
+ ---------------------------------------------------------------------------------
+ # G Codes
+ ### G0, G1 - Coordinated movement X Y Z E G0 & G1: Move
+ In Prusa Firmware G0 and G1 are the same.
+ #### Usage
+
+ G0 [ X | Y | Z | E | F | S ]
+ G1 [ X | Y | Z | E | F | S ]
+
+ #### Parameters
+ - `X` - The position to move to on the X axis
+ - `Y` - The position to move to on the Y axis
+ - `Z` - The position to move to on the Z axis
+ - `E` - The amount to extrude between the starting point and ending point
+ - `F` - The feedrate per minute of the move between the starting point and ending point (if supplied)
+
+ */
case 0: // G0 -> G1
case 1: // G1
if(Stopped == false) {
@@ -4130,8 +4167,25 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
}
break;
- //! ### G2 - CW ARC
- // ------------------------------
+ /*!
+ ### G2, G3 - Controlled Arc Move G2 & G3: Controlled Arc Move
+
+ These commands don't propperly work with MBL enabled. The compensation only happens at the end of the move, so avoid long arcs.
+
+ #### Usage
+
+ G2 [ X | Y | I | E | F ] (Clockwise Arc)
+ G3 [ X | Y | I | E | F ] (Counter-Clockwise Arc)
+
+ #### Parameters
+ - `X` - The position to move to on the X axis
+ - `Y` - The position to move to on the Y axis
+ - `I` - The point in X space from the current X position to maintain a constant distance from
+ - `J` - The point in Y space from the current Y position to maintain a constant distance from
+ - `E` - The amount to extrude between the starting point and ending point
+ - `F` - The feedrate per minute of the move between the starting point and ending point (if supplied)
+
+ */
case 2:
if(Stopped == false) {
get_arc_coordinates();
@@ -4139,8 +4193,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
}
break;
-
- //! ### G3 - CCW ARC
// -------------------------------
case 3:
if(Stopped == false) {
@@ -4150,8 +4202,19 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
break;
- //! ### G4 - Dwell
- // -------------------------------
+ /*!
+ ### G4 - Dwell G4: Dwell
+ Pause the machine for a period of time.
+
+ #### Usage
+
+ G4 [ P | S ]
+
+ #### Parameters
+ - `P` - Time to wait, in milliseconds
+ - `S` - Time to wait, in seconds
+
+ */
case 4:
codenum = 0;
if(code_seen('P')) codenum = code_value(); // milliseconds to wait
@@ -4169,8 +4232,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
#ifdef FWRETRACT
- //! ### G10 Retract
- // ------------------------------
+ /*!
+ ### G10 - Retract G10: Retract
+ Retracts filament according to settings of `M207`
+ */
case 10:
#if EXTRUDERS > 1
retracted_swap[active_extruder]=(code_seen('S') && code_value_long() == 1); // checks for swap retract argument
@@ -4181,8 +4246,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
break;
- //! ### G11 - Retract recover
- // -----------------------------
+ /*!
+ ### G11 - Retract recover G11: Unretract
+ Unretracts/recovers filament according to settings of `M208`
+ */
case 11:
#if EXTRUDERS > 1
retract(false,retracted_swap[active_extruder]);
@@ -4193,8 +4260,20 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
#endif //FWRETRACT
- //! ### G28 - Home all Axis one at a time
- // --------------------------------------------
+ /*!
+ ### G28 - Home all Axes one at a time G28: Move to Origin (Home)
+ Using `G28` without any parameters will perfom homing of all axes AND mesh bed leveling, while `G28 W` will just home all axes (no mesh bed leveling).
+ #### Usage
+
+ G28 [ X | Y | Z | W | C ]
+
+ #### Parameters
+ - `X` - Flag to go back to the X axis origin
+ - `Y` - Flag to go back to the Y axis origin
+ - `Z` - Flag to go back to the Z axis origin
+ - `W` - Suppress mesh bed leveling if `X`, `Y` or `Z` are not provided
+ - `C` - Calibrate X and Y origin (home) - Only on MK3/s
+ */
case 28:
{
long home_x_value = 0;
@@ -4226,8 +4305,12 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
#ifdef ENABLE_AUTO_BED_LEVELING
- //! ### G29 - Detailed Z-Probe
- // --------------------------------
+ /*!
+ ### G29 - Detailed Z-Probe G29: Detailed Z-Probe
+ In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.
+
+ See `G81`
+ */
case 29:
{
#if Z_MIN_PIN == -1
@@ -4372,8 +4455,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
break;
#ifndef Z_PROBE_SLED
- //! ### G30 - Single Z Probe
- // ------------------------------------
+ /*!
+ ### G30 - Single Z Probe G30: Single Z-Probe
+ In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.
+ */
case 30:
{
st_synchronize();
@@ -4397,15 +4482,19 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
break;
#else
- //! ### G31 - Dock the sled
- // ---------------------------
+ /*!
+ ### G31 - Dock the sled G31: Dock Z Probe sled
+ In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.
+ */
case 31:
dock_sled(true);
break;
- //! ### G32 - Undock the sled
- // ----------------------------
+ /*!
+ ### G32 - Undock the sled G32: Undock Z Probe sled
+ In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.
+ */
case 32:
dock_sled(false);
break;
@@ -4414,8 +4503,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
#ifdef MESH_BED_LEVELING
- //! ### G30 - Single Z Probe
- // ----------------------------
+ /*!
+ ### G30 - Single Z Probe G30: Single Z-Probe
+ Sensor must be over the bed.
+ The maximum travel distance before an error is triggered is 10mm.
+ */
case 30:
{
st_synchronize();
@@ -4432,8 +4524,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
}
break;
- //! ### G75 - Print temperature interpolation
- // ---------------------------------------------
+ /*!
+ ### G75 - Print temperature interpolation G75: Print temperature interpolation
+ Show/print PINDA temperature interpolating.
+ */
case 75:
{
for (int i = 40; i <= 110; i++)
@@ -4441,9 +4535,26 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
}
break;
- //! ### G76 - PINDA probe temperature calibration
- // ------------------------------------------------
- case 76:
+ /*!
+ ### G76 - PINDA probe temperature calibration G76: PINDA probe temperature calibration
+ This G-code is used to calibrate the temperature drift of the PINDA (inductive Sensor).
+
+ The PINDAv2 sensor has a built-in thermistor which has the advantage that the calibration can be done once for all materials.
+
+ The Original i3 Prusa MK2/s uses PINDAv1 and this calibration improves the temperature drift, but not as good as the PINDAv2.
+
+ #### Example
+
+ ```
+ G76
+
+ echo PINDA probe calibration start
+ echo start temperature: 35.0°
+ echo ...
+ echo PINDA temperature -- Z shift (mm): 0.---
+ ```
+ */
+ case 76:
{
#ifdef PINDA_THERMISTOR
if (true)
@@ -4700,11 +4811,28 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
break;
- //! ### G80 - Mesh-based Z probe
- // -----------------------------------
+ /*!
+ ### G80 - Mesh-based Z probe G80: Mesh-based Z probe
+ Default 3x3 grid can be changed on MK2.5/s and MK3/s to 7x7 grid.
+ #### Usage
+
+ G80 [ N | R | V | L | R | F | B ]
+
+ #### Parameters
+ - `N` - Number of mesh points on x axis. Default is 3. Valid values are 3 and 7.
+ - `R` - Probe retries. Default 3 max. 10
+ - `V` - Verbosity level 1=low, 10=mid, 20=high. It only can be used if the firmware has been compiled with SUPPORT_VERBOSITY active.
+
+ Using the following parameters enables additional "manual" bed leveling correction. Valid values are -100 microns to 100 microns.
+ #### Additional Parameters
+ - `L` - Left Bed Level correct value in um.
+ - `R` - Right Bed Level correct value in um.
+ - `F` - Front Bed Level correct value in um.
+ - `B` - Back Bed Level correct value in um.
+ */
/*
- * Probes a grid and produces a mesh to compensate for variable bed height
+ * Probes a grid and produces a mesh to compensate for variable bed height
* The S0 report the points as below
* +----> X-axis
* |
@@ -5120,12 +5248,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
}
break;
- //! ### G81 - Mesh bed leveling status
- // -----------------------------------------
-
- /*
- * Prints mesh bed leveling status and bed profile if activated
- */
+ /*!
+ ### G81 - Mesh bed leveling status G81: Mesh bed leveling status
+ Prints mesh bed leveling status and bed profile if activated.
+ */
case 81:
if (mbl.active) {
SERIAL_PROTOCOLPGM("Num X,Y: ");
@@ -5148,12 +5274,12 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
break;
#if 0
- /*
- * G82: Single Z probe at current location
- *
- * WARNING! USE WITH CAUTION! If you'll try to probe where is no leveling pad, nasty things can happen!
- *
- */
+ /*!
+ ### G82: Single Z probe at current location - Not active G82: Single Z probe at current location
+
+ WARNING! USE WITH CAUTION! If you'll try to probe where is no leveling pad, nasty things can happen!
+ In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.
+ */
case 82:
SERIAL_PROTOCOLLNPGM("Finding bed ");
int l_feedmultiply = setup_for_endstop_move();
@@ -5164,9 +5290,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
SERIAL_PROTOCOLPGM("\n");
break;
- /*
- * G83: Prusa3D specific: Babystep in Z and store to EEPROM
- */
+ /*!
+ ### G83: Babystep in Z and store to EEPROM - Not active G83: Babystep in Z and store to EEPROM
+ In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.
+ */
case 83:
{
int babystepz = code_seen('S') ? code_value() : 0;
@@ -5189,50 +5316,50 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
}
break;
- /*
- * G84: Prusa3D specific: UNDO Babystep Z (move Z axis back)
- */
+ /*!
+ ### G84: UNDO Babystep Z (move Z axis back) - Not active G84: UNDO Babystep Z (move Z axis back)
+ In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.
+ */
case 84:
babystepsTodoZsubtract(babystepLoadZ);
// babystepLoadZ = 0;
break;
- /*
- * G85: Prusa3D specific: Pick best babystep
- */
+ /*!
+ ### G85: Pick best babystep - Not active G85: Pick best babystep
+ In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.
+ */
case 85:
lcd_pick_babystep();
break;
#endif
- /**
- * ### G86 - Disable babystep correction after home
- *
- * This G-code will be performed at the start of a calibration script.
- * (Prusa3D specific)
- */
+ /*!
+ ### G86 - Disable babystep correction after home G86: Disable babystep correction after home
+
+ This G-code will be performed at the start of a calibration script.
+ (Prusa3D specific)
+ */
case 86:
calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST);
break;
- /**
- * ### G87 - Enable babystep correction after home
- *
- *
- * This G-code will be performed at the end of a calibration script.
- * (Prusa3D specific)
- */
+ /*!
+ ### G87 - Enable babystep correction after home G87: Enable babystep correction after home
+
+ This G-code will be performed at the end of a calibration script.
+ (Prusa3D specific)
+ */
case 87:
calibration_status_store(CALIBRATION_STATUS_CALIBRATED);
break;
-
- /**
- * ### G88 - Reserved
- *
- * Currently has no effect.
- */
+ /*!
+ ### G88 - Reserved G88: Reserved
+
+ Currently has no effect.
+ */
// Prusa3D specific: Don't know what it is for, it is in V2Calibration.gcode
@@ -5242,32 +5369,56 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
#endif // ENABLE_MESH_BED_LEVELING
- //! ### G90 - Switch off relative mode
- // -------------------------------
+
+ /*!
+ ### G90 - Switch off relative mode G90: Set to Absolute Positioning
+ All coordinates from now on are absolute relative to the origin of the machine. E axis is also switched to absolute mode.
+ */
case 90: {
for(uint8_t i = 0; i != NUM_AXIS; ++i)
axis_relative_modes[i] = false;
}
break;
- //! ### G91 - Switch on relative mode
- // -------------------------------
+ /*!
+ ### G91 - Switch on relative mode G91: Set to Relative Positioning
+ All coordinates from now on are relative to the last position. E axis is also switched to relative mode.
+ */
case 91: {
for(uint8_t i = 0; i != NUM_AXIS; ++i)
axis_relative_modes[i] = true;
}
break;
- //! ### G92 - Set position
- // -----------------------------
+ /*!
+ ### G92 - Set position G92: Set Position
+
+ It is used for setting the current position of each axis. The parameters are always absolute to the origin.
+ If a parameter is omitted, that axis will not be affected.
+ If `X`, `Y`, or `Z` axis are specified, the move afterwards might stutter because of Mesh Bed Leveling. `E` axis is not affected if the target position is 0 (`G92 E0`).
+ A G92 without coordinates will reset all axes to zero on some firmware. This is not the case for Prusa-Firmware!
+
+ #### Usage
+
+ G92 [ X | Y | Z | E ]
+
+ #### Parameters
+ - `X` - new X axis position
+ - `Y` - new Y axis position
+ - `Z` - new Z axis position
+ - `E` - new extruder position
+
+ */
case 92: {
gcode_G92();
}
break;
-
- //! ### G98 - Activate farm mode
- // -----------------------------------
+ /*!
+ ### G98 - Activate farm mode G98: Activate farm mode
+ Enable Prusa-specific Farm functions and g-code.
+ See Internal Prusa commands.
+ */
case 98:
farm_mode = 1;
PingTime = _millis();
@@ -5278,8 +5429,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
fCheckModeInit(); // alternatively invoke printer reset
break;
- //! ### G99 - Deactivate farm mode
- // -------------------------------------
+ /*! ### G99 - Deactivate farm mode G99: Deactivate farm mode
+ Disables Prusa-specific Farm functions and g-code.
+ */
case 99:
farm_mode = 0;
lcd_printer_connected();
@@ -5293,9 +5445,15 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
// printf_P(_N("END G-CODE=%u\n"), gcode_in_progress);
gcode_in_progress = 0;
} // end if(code_seen('G'))
+ /*!
+ ### End of G-Codes
+ */
-
- //! ---------------------------------------------------------------------------------
+ /*!
+ ---------------------------------------------------------------------------------
+ # M Commands
+
+ */
else if(code_seen('M'))
{
@@ -5315,8 +5473,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
switch(mcode_in_progress)
{
- //! ### M0, M1 - Stop the printer
- // ---------------------------------------------------------------
+ /*!
+ ### M0, M1 - Stop the printer M0: Stop or Unconditional stop
+ */
case 0: // M0 - Unconditional stop - Wait for user button press on LCD
case 1: // M1 - Conditional stop - Wait for user button press on LCD
{
@@ -5365,8 +5524,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
}
break;
- //! ### M17 - Enable axes
- // ---------------------------------
+ /*!
+ ### M17 - Enable all axes M17: Enable/Power all stepper motors
+ */
case 17:
LCD_MESSAGERPGM(_i("No move."));////MSG_NO_MOVE
enable_x();
@@ -5379,28 +5539,36 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
#ifdef SDSUPPORT
- //! ### M20 - SD Card file list
- // -----------------------------------
+ /*!
+ ### M20 - SD Card file list M20: List SD card
+ */
case 20:
SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST
card.ls();
SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST
break;
- //! ### M21 - Init SD card
- // ------------------------------------
+ /*!
+ ### M21 - Init SD card M21: Initialize SD card
+ */
case 21:
card.initsd();
break;
- //! ### M22 - Release SD card
- // -----------------------------------
+ /*!
+ ### M22 - Release SD card M22: Release SD card
+ */
case 22:
card.release();
break;
- //! ### M23 - Select file
- // -----------------------------------
+ /*!
+ ### M23 - Select file M23: Select SD file
+ #### Usage
+
+ M23 [filename]
+
+ */
case 23:
starpos = (strchr(strchr_pointer + 4,'*'));
if(starpos!=NULL)
@@ -5408,8 +5576,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
card.openFile(strchr_pointer + 4,true);
break;
- //! ### M24 - Start/resume SD print
- // ----------------------------------
+ /*!
+ ### M24 - Start SD print M24: Start/resume SD print
+ */
case 24:
if (isPrintPaused)
lcd_resume_print();
@@ -5424,11 +5593,18 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
}
break;
- //! ### M26 S\ - Set SD index
- //! Set position in SD card file to index in bytes.
- //! This command is expected to be called after M23 and before M24.
- //! Otherwise effect of this command is undefined.
- // ----------------------------------
+ /*!
+ ### M26 - Set SD index M26: Set SD position
+ Set position in SD card file to index in bytes.
+ This command is expected to be called after M23 and before M24.
+ Otherwise effect of this command is undefined.
+ #### Usage
+
+ M26 [ S ]
+
+ #### Parameters
+ - `S` - Index in bytes
+ */
case 26:
if(card.cardOK && code_seen('S')) {
long index = code_value_long();
@@ -5439,14 +5615,16 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
}
break;
- //! ### M27 - Get SD status
- // ----------------------------------
+ /*!
+ ### M27 - Get SD status M27: Report SD print status
+ */
case 27:
card.getStatus();
break;
- //! ### M28 - Start SD write
- // ---------------------------------
+ /*!
+ ### M28 - Start SD write M28: Begin write to SD card
+ */
case 28:
starpos = (strchr(strchr_pointer + 4,'*'));
if(starpos != NULL){
@@ -5457,16 +5635,21 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
card.openFile(strchr_pointer+4,false);
break;
- //! ### M29 - Stop SD write
- // -------------------------------------
- //! Currently has no effect.
+ /*! ### M29 - Stop SD write M29: Stop writing to SD card
+ Stops writing to the SD file signaling the end of the uploaded file. It is processed very early and it's not written to the card.
+ */
case 29:
//processed in write to file routine above
//card,saving = false;
break;
- //! ### M30 - Delete file
- // ----------------------------------
+ /*!
+ ### M30 - Delete file M30: Delete a file on the SD card
+ #### Usage
+
+ M30 [filename]
+
+ */
case 30:
if (card.cardOK){
card.closefile();
@@ -5480,8 +5663,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
}
break;
- //! ### M32 - Select file and start SD print
- // ------------------------------------
+ /*!
+ ### M32 - Select file and start SD print M32: Select file and start SD print
+ @todo What are the parameters P and S for in M32?
+ */
case 32:
{
if(card.sdprinting) {
@@ -5521,8 +5706,13 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
}
} break;
- //! ### M982 - Start SD write
- // ---------------------------------
+ /*!
+ ### M928 - Start SD logging M928: Start SD logging
+ #### Usage
+
+ M928 [filename]
+
+ */
case 928:
starpos = (strchr(strchr_pointer + 5,'*'));
if(starpos != NULL){
@@ -5535,8 +5725,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
#endif //SDSUPPORT
- //! ### M31 - Report current print time
- // --------------------------------------------------
+ /*!
+ ### M31 - Report current print time M31: Output time since last M109 or SD card start to serial
+ */
case 31: //M31 take time since the start of the SD print or an M109 command
{
stoptime=_millis();
@@ -5553,8 +5744,17 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
}
break;
- //! ### M42 - Set pin state
- // -----------------------------
+ /*!
+ ### M42 - Set pin state M42: Switch I/O pin
+ #### Usage
+
+ M42 [ P | S ]
+
+ #### Parameters
+ - `P` - Pin number.
+ - `S` - Pin value. If the pin is analog, values are from 0 to 255. If the pin is digital, values are from 0 to 1.
+
+ */
case 42:
if (code_seen('S'))
{
@@ -5584,8 +5784,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
break;
- //! ### M44 - Reset the bed skew and offset calibration (Prusa specific)
- // --------------------------------------------------------------------
+ /*!
+ ### M44 - Reset the bed skew and offset calibration M44: Reset the bed skew and offset calibration
+ */
case 44: // M44: Prusa3D: Reset the bed skew and offset calibration.
// Reset the baby step value and the baby step applied flag.
@@ -5600,8 +5801,15 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
world2machine_revert_to_uncorrected();
break;
- //! ### M45 - Bed skew and offset with manual Z up (Prusa specific)
- // ------------------------------------------------------
+ /*!
+ ### M45 - Bed skew and offset with manual Z up M45: Bed skew and offset with manual Z up
+ #### Usage
+
+ M45 [ V ]
+ #### Parameters
+ - `V` - Verbosity level 1, 10 and 20 (low, mid, high). Only when SUPPORT_VERBOSITY is defined. Optional.
+ - `Z` - If it is provided, only Z calibration will run. Otherwise full calibration is executed.
+ */
case 45: // M45: Prusa3D: bed skew and offset with manual Z up
{
int8_t verbosity_level = 0;
@@ -5618,8 +5826,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
}
break;
+ /*!
+ ### M46 - Show the assigned IP address M46: Show the assigned IP address.
+ */
/*
- case 46:
+ case 46:
{
// M46: Prusa3D: Show the assigned IP address.
uint8_t ip[4];
@@ -5641,8 +5852,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
}
*/
- //! ### M47 - Show end stops dialog on the display (Prusa specific)
- // ----------------------------------------------------
+ /*!
+ ### M47 - Show end stops dialog on the display M47: Show end stops dialog on the display
+ */
case 47:
KEEPALIVE_STATE(PAUSED_FOR_USER);
@@ -5690,22 +5902,25 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
#ifdef ENABLE_AUTO_BED_LEVELING
#ifdef Z_PROBE_REPEATABILITY_TEST
- //! ### M48 - Z-Probe repeatability measurement function.
- // ------------------------------------------------------
- //!
- //! _Usage:_
- //!
- //! M48
- //!
- //! This function assumes the bed has been homed. Specifically, that a G28 command
- //! as been issued prior to invoking the M48 Z-Probe repeatability measurement function.
- //! Any information generated by a prior G29 Bed leveling command will be lost and need to be
- //! regenerated.
- //!
- //! The number of samples will default to 10 if not specified. You can use upper or lower case
- //! letters for any of the options EXCEPT n. n must be in lower case because Marlin uses a capital
- //! N for its communication protocol and will get horribly confused if you send it a capital N.
- //!
+ /*!
+ ### M48 - Z-Probe repeatability measurement function M48: Measure Z-Probe repeatability
+
+ This function assumes the bed has been homed. Specifically, that a G28 command as been issued prior to invoking the M48 Z-Probe repeatability measurement function. Any information generated by a prior G29 Bed leveling command will be lost and needs to be regenerated.
+
+ The number of samples will default to 10 if not specified. You can use upper or lower case letters for any of the options EXCEPT n. n must be in lower case because Marlin uses a capital N for its communication protocol and will get horribly confused if you send it a capital N.
+ @todo Why would you check for both uppercase and lowercase? Seems wasteful.
+
+ #### Usage
+
+ M48 [ n | X | Y | V | L ]
+
+ #### Parameters
+ - `n` - Number of samples. Valid values 4-50
+ - `X` - X position for samples
+ - `Y` - Y position for samples
+ - `V` - Verbose level. Valid values 1-4
+ - `L` - Legs of movementprior to doing probe. Valid values 1-15
+ */
case 48: // M48 Z-Probe repeatability
{
#if Z_MIN_PIN == -1
@@ -5944,12 +6159,18 @@ Sigma_Exit:
#endif // Z_PROBE_REPEATABILITY_TEST
#endif // ENABLE_AUTO_BED_LEVELING
- //! ### M73 - Set/get print progress
- // -------------------------------------
- //! _Usage:_
- //!
- //! M73 P R Q S
- //!
+ /*!
+ ### M73 - Set/get print progress M73: Set/Get build percentage
+ #### Usage
+
+ M73 [ P | R | Q | S ]
+
+ #### Parameters
+ - `P` - Percent in normal mode
+ - `R` - Time remaining in normal mode
+ - `Q` - Percent in silent mode
+ - `S` - Time in silent mode
+ */
case 73: //M73 show percent done and time remaining
if(code_seen('P')) print_percent_done_normal = code_value();
if(code_seen('R')) print_time_remaining_normal = code_value();
@@ -5963,8 +6184,15 @@ Sigma_Exit:
}
break;
- //! ### M104 - Set hotend temperature
- // -----------------------------------------
+ /*!
+ ### M104 - Set hotend temperature M104: Set Extruder Temperature
+ #### Usage
+
+ M104 [ S ]
+
+ #### Parameters
+ - `S` - Target temperature
+ */
case 104: // M104
{
uint8_t extruder;
@@ -5978,20 +6206,44 @@ Sigma_Exit:
break;
}
- //! ### M112 - Emergency stop
- // -----------------------------------------
+ /*!
+ ### M112 - Emergency stop M112: Full (Emergency) Stop
+ It is processed much earlier as to bypass the cmdqueue.
+ */
case 112:
kill(MSG_M112_KILL, 3);
break;
- //! ### M140 - Set bed temperature
- // -----------------------------------------
+ /*!
+ ### M140 - Set bed temperature M140: Set Bed Temperature (Fast)
+ #### Usage
+
+ M140 [ S ]
+
+ #### Parameters
+ - `S` - Target temperature
+ */
case 140:
if (code_seen('S')) setTargetBed(code_value());
break;
- //! ### M105 - Report temperatures
- // -----------------------------------------
+ /*!
+ ### M105 - Report temperatures M105: Get Extruder Temperature
+ Prints temperatures:
+
+ - `T:` - Hotend (actual / target)
+ - `B:` - Bed (actual / target)
+ - `Tx:` - x Tool (actual / target)
+ - `@:` - Hotend power
+ - `B@:` - Bed power
+ - `P:` - PINDAv2 actual (only MK2.5/s and MK3/s)
+ - `A:` - Ambient actual (only MK3/s)
+
+ _Example:_
+
+ ok T:20.2 /0.0 B:19.1 /0.0 T0:20.2 /0.0 @:0 B@:0 P:19.8 A:26.4
+
+ */
case 105:
{
uint8_t extruder;
@@ -6087,16 +6339,22 @@ Sigma_Exit:
break;
}
- //! ### M109 - Wait for extruder temperature
- //! Parameters (not mandatory):
- //! * S \ set extruder temperature
- //! * R \ set extruder temperature
- //!
- //! Parameters S and R are treated identically.
- //! Command always waits for both cool down and heat up.
- //! If no parameters are supplied waits for previously
- //! set extruder temperature.
- // -------------------------------------------------
+ /*!
+ ### M109 - Wait for extruder temperature M109: Set Extruder Temperature and Wait
+ #### Usage
+
+ M104 [ B | R | S ]
+
+ #### Parameters (not mandatory)
+
+ - `S` - Set extruder temperature
+ - `R` - Set extruder temperature
+ - `B` - Set max. extruder temperature, while `S` is min. temperature. Not active in default, only if AUTOTEMP is defined in source code.
+
+ Parameters S and R are treated identically.
+ Command always waits for both cool down and heat up.
+ If no parameters are supplied waits for previously set extruder temperature.
+ */
case 109:
{
uint8_t extruder;
@@ -6146,12 +6404,19 @@ Sigma_Exit:
}
break;
- //! ### M190 - Wait for bed temperature
- //! Parameters (not mandatory):
- //! * S \ set extruder temperature and wait for heating
- //! * R \ set extruder temperature and wait for heating or cooling
- //!
- //! If no parameter is supplied, waits for heating or cooling to previously set temperature.
+ /*!
+ ### M190 - Wait for bed temperature M190: Wait for bed temperature to reach target temp
+ #### Usage
+
+ M190 [ R | S ]
+
+ #### Parameters (not mandatory)
+
+ - `S` - Set extruder temperature and wait for heating
+ - `R` - Set extruder temperature and wait for heating or cooling
+
+ If no parameter is supplied, waits for heating or cooling to previously set temperature.
+ */
case 190:
#if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
{
@@ -6206,8 +6471,15 @@ Sigma_Exit:
#if defined(FAN_PIN) && FAN_PIN > -1
- //! ### M106 - Set fan speed
- // -------------------------------------------
+ /*!
+ ### M106 - Set fan speed M106: Fan On
+ #### Usage
+
+ M106 [ S ]
+
+ #### Parameters
+ - `S` - Specifies the duty cycle of the print fan. Allowed values are 0-255. If it's omitted, a value of 255 is used.
+ */
case 106: // M106 Sxxx Fan On S 0 .. 255
if (code_seen('S')){
fanSpeed=constrain(code_value(),0,255);
@@ -6217,8 +6489,9 @@ Sigma_Exit:
}
break;
- //! ### M107 - Fan off
- // -------------------------------
+ /*!
+ ### M107 - Fan off M107: Fan Off
+ */
case 107:
fanSpeed = 0;
break;
@@ -6226,8 +6499,10 @@ Sigma_Exit:
#if defined(PS_ON_PIN) && PS_ON_PIN > -1
- //! ### M80 - Turn on the Power Supply
- // -------------------------------
+ /*!
+ ### M80 - Turn on the Power Supply M80: ATX Power On
+ Only works if the firmware is compiled with PS_ON_PIN defined.
+ */
case 80:
SET_OUTPUT(PS_ON_PIN); //GND
WRITE(PS_ON_PIN, PS_ON_AWAKE);
@@ -6245,8 +6520,10 @@ Sigma_Exit:
lcd_update(0);
break;
- //! ### M81 - Turn off Power Supply
- // --------------------------------------
+ /*!
+ ### M81 - Turn off Power Supply M81: ATX Power Off
+ Only works if the firmware is compiled with PS_ON_PIN defined.
+ */
case 81:
disable_heater();
st_synchronize();
@@ -6269,24 +6546,40 @@ Sigma_Exit:
break;
#endif
- //! ### M82 - Set E axis to absolute mode
- // ---------------------------------------
+ /*!
+ ### M82 - Set E axis to absolute mode M82: Set extruder to absolute mode
+ Makes the extruder interpret extrusion as absolute positions.
+ */
case 82:
axis_relative_modes[E_AXIS] = false;
break;
- //! ### M83 - Set E axis to relative mode
- // ---------------------------------------
+ /*!
+ ### M83 - Set E axis to relative mode M83: Set extruder to relative mode
+ Makes the extruder interpret extrusion values as relative positions.
+ */
case 83:
axis_relative_modes[E_AXIS] = true;
break;
- //! ### M84, M18 - Disable steppers
- //---------------------------------------
- //! This command can be used to set the stepper inactivity timeout (`S`) or to disable steppers (`X`,`Y`,`Z`,`E`)
- //!
- //! M84 [E] [S] [X] [Y] [Z]
- //!
+ /*!
+ ### M84 - Disable steppers M84: Stop idle hold
+ This command can be used to set the stepper inactivity timeout (`S`) or to disable steppers (`X`,`Y`,`Z`,`E`)
+ This command can be used without any additional parameters. In that case all steppers are disabled.
+
+ The file completeness check uses this parameter to detect an incomplete file. It has to be present at the end of a file with no parameters.
+
+ M84 [ S | X | Y | Z | E ]
+
+ - `S` - Seconds
+ - `X` - X axis
+ - `Y` - Y axis
+ - `Z` - Z axis
+ - `E` - Exruder
+
+ ### M18 - Disable steppers M18: Disable all stepper motors
+ Equal to M84 (compatibility)
+ */
case 18: //compatibility
case 84: // M84
if(code_seen('S')){
@@ -6323,8 +6616,15 @@ Sigma_Exit:
snmm_filaments_used = 0;
break;
- //! ### M85 - Set max inactive time
- // ---------------------------------------
+ /*!
+ ### M85 - Set max inactive time M85: Set Inactivity Shutdown Timer
+ #### Usage
+
+ M85 [ S ]
+
+ #### Parameters
+ - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled.
+ */
case 85: // M85
if(code_seen('S')) {
max_inactive_time = code_value() * 1000;
@@ -6332,13 +6632,16 @@ Sigma_Exit:
break;
#ifdef SAFETYTIMER
- //! ### M86 - Set safety timer expiration time
- //!
- //! _Usage:_
- //! M86 S
- //!
- //! Sets the safety timer expiration time in seconds. M86 S0 will disable safety timer.
- //! When safety timer expires, heatbed and nozzle target temperatures are set to zero.
+ /*!
+ ### M86 - Set safety timer expiration time M86: Set Safety Timer expiration time
+ When safety timer expires, heatbed and nozzle target temperatures are set to zero.
+ #### Usage
+
+ M86 [ S ]
+
+ #### Parameters
+ - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled.
+ */
case 86:
if (code_seen('S')) {
safetytimer_inactive_time = code_value() * 1000;
@@ -6347,9 +6650,19 @@ Sigma_Exit:
break;
#endif
- //! ### M92 Set Axis steps-per-unit
- // ---------------------------------------
- //! Same syntax as G92
+ /*!
+ ### M92 Set Axis steps-per-unit M92: Set axis_steps_per_unit
+ Allows programming of steps per unit (usually mm) for motor drives. These values are reset to firmware defaults on power on, unless saved to EEPROM if available (M500 in Marlin)
+ #### Usage
+
+ M92 [ X | Y | Z | E ]
+
+ #### Parameters
+ - `X` - Steps per unit for the X drive
+ - `Y` - Steps per unit for the Y drive
+ - `Z` - Steps per unit for the Z drive
+ - `E` - Steps per unit for the extruder drive
+ */
case 92:
for(int8_t i=0; i < NUM_AXIS; i++)
{
@@ -6372,15 +6685,31 @@ Sigma_Exit:
}
break;
- //! ### M110 - Set Line number
- // ---------------------------------------
+ /*!
+ ### M110 - Set Line number M110: Set Current Line Number
+ Sets the line number in G-code
+ #### Usage
+
+ M110 [ N ]
+
+ #### Parameters
+ - `N` - Line number
+ */
case 110:
if (code_seen('N'))
gcode_LastN = code_value_long();
break;
- //! ### M113 - Get or set host keep-alive interval
- // ------------------------------------------
+ /*!
+ ### M113 - Get or set host keep-alive interval M113: Host Keepalive
+ During some lengthy processes, such as G29, Marlin may appear to the host to have “gone away.” The “host keepalive” feature will send messages to the host when Marlin is busy or waiting for user response so the host won’t try to reconnect (or disconnect).
+ #### Usage
+
+ M113 [ S ]
+
+ #### Parameters
+ - `S` - Seconds. Default is 2 seconds between "busy" messages
+ */
case 113:
if (code_seen('S')) {
host_keepalive_interval = (uint8_t)code_value_short();
@@ -6393,16 +6722,34 @@ Sigma_Exit:
}
break;
- //! ### M115 - Firmware info
- // --------------------------------------
- //! Print the firmware info and capabilities
- //!
- //! M115 [V] [U]
- //!
- //! Without any arguments, prints Prusa firmware version number, machine type, extruder count and UUID.
- //! `M115 U` Checks the firmware version provided. If the firmware version provided by the U code is higher than the currently running firmware,
- //! pause the print for 30s and ask the user to upgrade the firmware.
- case 115: // M115
+ /*!
+ ### M115 - Firmware info M115: Get Firmware Version and Capabilities
+ Print the firmware info and capabilities
+ Without any arguments, prints Prusa firmware version number, machine type, extruder count and UUID.
+ `M115 U` Checks the firmware version provided. If the firmware version provided by the U code is higher than the currently running firmware, it will pause the print for 30s and ask the user to upgrade the firmware.
+
+ _Examples:_
+
+ `M115` results:
+
+ `FIRMWARE_NAME:Prusa-Firmware 3.8.1 based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa i3 MK3S EXTRUDER_COUNT:1 UUID:00000000-0000-0000-0000-000000000000`
+
+ `M115 V` results:
+
+ `3.8.1`
+
+ `M115 U3.8.2-RC1` results on LCD display for 30s or user interaction:
+
+ `New firmware version available: 3.8.2-RC1 Please upgrade.`
+ #### Usage
+
+ M115 [ V | U ]
+
+ #### Parameters
+ - V - Report current installed firmware version
+ - U - Firmware version provided by G-code to be compared to current one.
+ */
+ case 115: // M115
if (code_seen('V')) {
// Report the Prusa version number.
SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P());
@@ -6424,16 +6771,13 @@ Sigma_Exit:
}
break;
- //! ### M114 - Get current position
- // -------------------------------------
+ /*!
+ ### M114 - Get current position M114: Get Current Position
+ */
case 114:
gcode_M114();
break;
-
-
- //! ### M117 - Set LCD Message
- // --------------------------------------
/*
M117 moved up to get the high priority
@@ -6445,20 +6789,24 @@ Sigma_Exit:
lcd_setstatus(strchr_pointer + 5);
break;*/
- //! ### M120 - Disable endstops
- // ----------------------------------------
+ /*!
+ ### M120 - Enable endstops M120: Enable endstop detection
+ */
case 120:
enable_endstops(false) ;
break;
- //! ### M121 - Enable endstops
- // ----------------------------------------
+ /*!
+ ### M121 - Disable endstops M121: Disable endstop detection
+ */
case 121:
enable_endstops(true) ;
break;
- //! ### M119 - Get endstop states
- // ----------------------------------------
+ /*!
+ ### M119 - Get endstop states M119: Get Endstop Status
+ Returns the current state of the configured X, Y, Z endstops. Takes into account any 'inverted endstop' settings, so one can confirm that the machine is interpreting the endstops correctly.
+ */
case 119:
SERIAL_PROTOCOLRPGM(_N("Reporting endstop status"));////MSG_M119_REPORT
SERIAL_PROTOCOLLN("");
@@ -6517,12 +6865,22 @@ Sigma_Exit:
SERIAL_PROTOCOLLN("");
#endif
break;
- //TODO: update for all axis, use for loop
+ //!@todo update for all axes, use for loop
- #ifdef BLINKM
- //! ### M150 - Set RGB(W) Color
- // -------------------------------------------
+ #ifdef BLINKM
+ /*!
+ ### M150 - Set RGB(W) Color M150: Set LED color
+ In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code by defining BLINKM and its dependencies.
+ #### Usage
+
+ M150 [ R | U | B ]
+
+ #### Parameters
+ - `R` - Red color value
+ - `U` - Green color value. It is NOT `G`!
+ - `B` - Blue color value
+ */
case 150:
{
byte red;
@@ -6538,8 +6896,16 @@ Sigma_Exit:
break;
#endif //BLINKM
- //! ### M200 - Set filament diameter
- // ----------------------------------------
+ /*!
+ ### M200 - Set filament diameter M200: Set filament diameter
+ #### Usage
+
+ M200 [ D | T ]
+
+ #### Parameters
+ - `D` - Diameter in mm
+ - `T` - Number of extruder (MMUs)
+ */
case 200: // M200 D set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).
{
@@ -6564,10 +6930,10 @@ Sigma_Exit:
// make sure all extruders have some sane value for the filament size
cs.filament_size[0] = (cs.filament_size[0] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[0]);
#if EXTRUDERS > 1
- cs.filament_size[1] = (cs.filament_size[1] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[1]);
- #if EXTRUDERS > 2
- cs.filament_size[2] = (cs.filament_size[2] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[2]);
- #endif
+ cs.filament_size[1] = (cs.filament_size[1] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[1]);
+ #if EXTRUDERS > 2
+ cs.filament_size[2] = (cs.filament_size[2] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[2]);
+ #endif
#endif
cs.volumetric_enabled = true;
}
@@ -6579,8 +6945,10 @@ Sigma_Exit:
}
break;
- //! ### M201 - Set Print Max Acceleration
- // -------------------------------------------
+ /*!
+ ### M201 - Set Print Max Acceleration M201: Set max printing acceleration
+ For each axis individually.
+ */
case 201:
for (int8_t i = 0; i < NUM_AXIS; i++)
{
@@ -6614,8 +6982,10 @@ Sigma_Exit:
break;
#endif
- //! ### M203 - Set Max Feedrate
- // ---------------------------------------
+ /*!
+ ### M203 - Set Max Feedrate M203: Set maximum feedrate
+ For each axis individually.
+ */
case 203: // M203 max feedrate mm/sec
for (int8_t i = 0; i < NUM_AXIS; i++)
{
@@ -6640,15 +7010,28 @@ Sigma_Exit:
}
break;
- //! ### M204 - Acceleration settings
- // ------------------------------------------
- //! Supporting old format:
- //!
- //! M204 S[normal moves] T[filmanent only moves]
- //!
- //! and new format:
- //!
- //! M204 P[printing moves] R[filmanent only moves] T[travel moves] (as of now T is ignored)
+ /*!
+ ### M204 - Acceleration settings M204: Set default acceleration
+
+ #### Old format:
+ ##### Usage
+
+ M204 [ S | T ]
+
+ ##### Parameters
+ - `S` - normal moves
+ - `T` - filmanent only moves
+
+ #### New format:
+ ##### Usage
+
+ M204 [ P | R | T ]
+
+ ##### Parameters
+ - `P` - printing moves
+ - `R` - filmanent only moves
+ - `T` - travel moves (as of now T is ignored)
+ */
case 204:
{
if(code_seen('S')) {
@@ -6667,23 +7050,30 @@ Sigma_Exit:
cs.retract_acceleration = code_value();
if(code_seen('T')) {
// Interpret the T value as the travel acceleration in the new Marlin format.
- //FIXME Prusa3D firmware currently does not support travel acceleration value independent from the extruding acceleration value.
+ /*!
+ @todo Prusa3D firmware currently does not support travel acceleration value independent from the extruding acceleration value.
+ */
// travel_acceleration = code_value();
}
}
}
break;
- //! ### M205 - Set advanced settings
- // ---------------------------------------------
- //! Set some advanced settings related to movement.
- //!
- //! M205 [S] [T] [B] [X] [Y] [Z] [E]
/*!
+ ### M205 - Set advanced settings M205: Advanced settings
+ Set some advanced settings related to movement.
+ #### Usage
+
+ M205 [ S | T | B | X | Y | Z | E ]
+
+ #### Parameters
- `S` - Minimum feedrate for print moves (unit/s)
- `T` - Minimum feedrate for travel moves (units/s)
- `B` - Minimum segment time (us)
- - `X` - Maximum X jerk (units/s), similarly for other axes
+ - `X` - Maximum X jerk (units/s)
+ - `Y` - Maximum Y jerk (units/s)
+ - `Z` - Maximum Z jerk (units/s)
+ - `E` - Maximum E jerk (units/s)
*/
case 205:
{
@@ -6699,8 +7089,17 @@ Sigma_Exit:
}
break;
- //! ### M206 - Set additional homing offsets
- // ----------------------------------------------
+ /*!
+ ### M206 - Set additional homing offsets M206: Offset axes
+ #### Usage
+
+ M206 [ X | Y | Z ]
+
+ #### Parameters
+ - `X` - X axis offset
+ - `Y` - Y axis offset
+ - `Z` - Z axis offset
+ */
case 206:
for(int8_t i=0; i < 3; i++)
{
@@ -6709,8 +7108,17 @@ Sigma_Exit:
break;
#ifdef FWRETRACT
- //! ### M207 - Set firmware retraction
- // --------------------------------------------------
+ /*!
+ ### M207 - Set firmware retraction M207: Set retract length
+ #### Usage
+
+ M207 [ S | F | Z ]
+
+ #### Parameters
+ - `S` - positive length to retract, in mm
+ - `F` - retraction feedrate, in mm/min
+ - `Z` - additional zlift/hop
+ */
case 207: //M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop]
{
if(code_seen('S'))
@@ -6727,8 +7135,16 @@ Sigma_Exit:
}
}break;
- //! ### M208 - Set retract recover length
- // --------------------------------------------
+ /*!
+ ### M208 - Set retract recover length M208: Set unretract length
+ #### Usage
+
+ M208 [ S | F ]
+
+ #### Parameters
+ - `S` - positive length surplus to the M207 Snnn, in mm
+ - `F` - feedrate, in mm/sec
+ */
case 208: // M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/min]
{
if(code_seen('S'))
@@ -6741,8 +7157,16 @@ Sigma_Exit:
}
}break;
- //! ### M209 - Enable/disable automatict retract
- // ---------------------------------------------
+ /*!
+ ### M209 - Enable/disable automatict retract M209: Enable automatic retract
+ This boolean value S 1=true or 0=false enables automatic retract detect if the slicer did not support G10/G11: every normal extrude-only move will be classified as retract depending on the direction.
+ #### Usage
+
+ M209 [ S ]
+
+ #### Parameters
+ - `S` - 1=true or 0=false
+ */
case 209: // M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction.
{
if(code_seen('S'))
@@ -6784,8 +7208,17 @@ Sigma_Exit:
#endif // FWRETRACT
#if EXTRUDERS > 1
- // ### M218 - Set hotend offset
- // ----------------------------------------
+ /*!
+ ### M218 - Set hotend offset M218: Set Hotend Offset
+ In Prusa Firmware this G-code is only active if `EXTRUDERS` is higher then 1 in the source code. On Original i3 Prusa MK2/s MK2.5/s MK3/s it is not active.
+ #### Usage
+
+ M218 [ X | Y ]
+
+ #### Parameters
+ - `X` - X offset
+ - `Y` - Y offset
+ */
case 218: // M218 - set hotend offset (in mm), T X Y
{
uint8_t extruder;
@@ -6813,8 +7246,17 @@ Sigma_Exit:
}break;
#endif
- //! ### M220 Set feedrate percentage
- // -----------------------------------------------
+ /*!
+ ### M220 Set feedrate percentage M220: Set speed factor override percentage
+ #### Usage
+
+ M220 [ B | S | R ]
+
+ #### Parameters
+ - `B` - Backup current speed factor
+ - `S` - Speed factor override percentage (0..100 or higher)
+ - `R` - Restore previous speed factor
+ */
case 220: // M220 S- set speed factor override percentage
{
if (code_seen('B')) //backup current speed factor
@@ -6831,8 +7273,16 @@ Sigma_Exit:
}
break;
- //! ### M221 - Set extrude factor override percentage
- // ----------------------------------------------------
+ /*!
+ ### M221 - Set extrude factor override percentage M221: Set extrude factor override percentage
+ #### Usage
+
+ M221 [ S | T ]
+
+ #### Parameters
+ - `S` - Extrude factor override percentage (0..100 or higher), default 100%
+ - `T` - Extruder drive number (Prusa Firmware only), default 0 if not set.
+ */
case 221: // M221 S- set extrude factor override percentage
{
if(code_seen('S'))
@@ -6855,8 +7305,17 @@ Sigma_Exit:
}
break;
- //! ### M226 - Wait for Pin state
- // ------------------------------------------
+ /*!
+ ### M226 - Wait for Pin state M226: Wait for pin state
+ Wait until the specified pin reaches the state required
+ #### Usage
+
+ M226 [ P | S ]
+
+ #### Parameters
+ - `P` - pin number
+ - `S` - pin state
+ */
case 226: // M226 P S- Wait until the specified pin reaches the state required
{
if(code_seen('P')){
@@ -6911,8 +7370,17 @@ Sigma_Exit:
#if NUM_SERVOS > 0
- //! ### M280 - Set/Get servo position
- // --------------------------------------------
+ /*!
+ ### M280 - Set/Get servo position M280: Set servo position
+ In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.
+ #### Usage
+
+ M280 [ P | S ]
+
+ #### Parameters
+ - `P` - Servo index (id)
+ - `S` - Target position
+ */
case 280: // M280 - set servo position absolute. P: servo index, S: angle or microseconds
{
int servo_index = -1;
@@ -6952,8 +7420,17 @@ Sigma_Exit:
#if (LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) || defined(LCD_USE_I2C_BUZZER)))
- //! ### M300 - Play tone
- // -----------------------
+ /*!
+ ### M300 - Play tone M300: Play beep sound
+ In Prusa Firmware the defaults are `100Hz` and `1000ms`, so that `M300` without parameters will beep for a second.
+ #### Usage
+
+ M300 [ S | P ]
+
+ #### Parameters
+ - `S` - frequency in Hz. Not all firmware versions support this parameter
+ - `P` - duration in milliseconds
+ */
case 300: // M300
{
int beepS = code_seen('S') ? code_value() : 110;
@@ -6974,8 +7451,20 @@ Sigma_Exit:
#ifdef PIDTEMP
- //! ### M301 - Set hotend PID
- // ---------------------------------------
+ /*!
+ ### M301 - Set hotend PID M301: Set PID parameters
+ Sets Proportional (P), Integral (I) and Derivative (D) values for hot end.
+ See also PID Tuning.
+ #### Usage
+
+ M301 [ P | I | D | C ]
+
+ #### Parameters
+ - `P` - proportional (Kp)
+ - `I` - integral (Ki)
+ - `D` - derivative (Kd)
+ - `C` - heating power=Kc*(e_speed0)
+ */
case 301:
{
if(code_seen('P')) cs.Kp = code_value();
@@ -7005,8 +7494,19 @@ Sigma_Exit:
#endif //PIDTEMP
#ifdef PIDTEMPBED
- //! ### M304 - Set bed PID
- // --------------------------------------
+ /*!
+ ### M304 - Set bed PID M304: Set PID parameters - Bed
+ Sets Proportional (P), Integral (I) and Derivative (D) values for bed.
+ See also PID Tuning.
+ #### Usage
+
+ M304 [ P | I | D ]
+
+ #### Parameters
+ - `P` - proportional (Kp)
+ - `I` - integral (Ki)
+ - `D` - derivative (Kd)
+ */
case 304:
{
if(code_seen('P')) cs.bedKp = code_value();
@@ -7026,8 +7526,13 @@ Sigma_Exit:
break;
#endif //PIDTEMP
- //! ### M240 - Trigger camera
- // --------------------------------------------
+ /*!
+ ### M240 - Trigger camera M240: Trigger camera
+
+ In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code.
+
+ You need to (re)define and assign `CHDK` or `PHOTOGRAPH_PIN` the correct pin number to be able to use the feature.
+ */
case 240: // M240 Triggers a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/
{
#ifdef CHDK
@@ -7061,8 +7566,16 @@ Sigma_Exit:
break;
#ifdef PREVENT_DANGEROUS_EXTRUDE
- //! ### M302 - Allow cold extrude, or set minimum extrude temperature
- // -------------------------------------------------------------------
+ /*!
+ ### M302 - Allow cold extrude, or set minimum extrude temperature M302: Allow cold extrudes
+ This tells the printer to allow movement of the extruder motor above a certain temperature, or if disabled, to allow extruder movement when the hotend is below a safe printing temperature.
+ #### Usage
+
+ M302 [ S ]
+
+ #### Parameters
+ - `S` - Cold extrude minimum temperature
+ */
case 302:
{
float temp = .0;
@@ -7072,8 +7585,18 @@ Sigma_Exit:
break;
#endif
- //! ### M303 - PID autotune
- // -------------------------------------
+ /*!
+ ### M303 - PID autotune M303: Run PID tuning
+ PID Tuning refers to a control algorithm used in some repraps to tune heating behavior for hot ends and heated beds. This command generates Proportional (Kp), Integral (Ki), and Derivative (Kd) values for the hotend or bed. Send the appropriate code and wait for the output to update the firmware values.
+ #### Usage
+
+ M303 [ E | S | C ]
+
+ #### Parameters
+ - `E` - Extruder, default `E0`. Use `E-1` to calibrate the bed PID
+ - `S` - Target temperature, default `210°C` for hotend, 70 for bed
+ - `C` - Cycles, default `5`
+ */
case 303:
{
float temp = 150.0;
@@ -7088,17 +7611,30 @@ Sigma_Exit:
}
break;
- //! ### M400 - Wait for all moves to finish
- // -----------------------------------------
+ /*!
+ ### M400 - Wait for all moves to finish M400: Wait for current moves to finish
+ Finishes all current moves and and thus clears the buffer.
+ Equivalent to `G4` with no parameters.
+ */
case 400:
{
st_synchronize();
}
break;
- //! ### M403 - Set filament type (material) for particular extruder and notify the MMU
- // ----------------------------------------------
- case 403:
+ /*!
+ ### M403 - Set filament type (material) for particular extruder and notify the MMU M403 - Set filament type (material) for particular extruder and notify the MMU
+ Currently three different materials are needed (default, flex and PVA).
+ And storing this information for different load/unload profiles etc. in the future firmware does not have to wait for "ok" from MMU.
+ #### Usage
+
+ M403 [ E | F ]
+
+ #### Parameters
+ - `E` - Extruder number. 0-indexed.
+ - `F` - Filament type
+ */
+ case 403:
{
// currently three different materials are needed (default, flex and PVA)
// add storing this information for different load/unload profiles etc. in the future
@@ -7114,40 +7650,51 @@ Sigma_Exit:
}
break;
- //! ### M500 - Store settings in EEPROM
- // -----------------------------------------
+ /*!
+ ### M500 - Store settings in EEPROM M500: Store parameters in non-volatile storage
+ Save current parameters to EEPROM.
+ */
case 500:
{
Config_StoreSettings();
}
break;
- //! ### M501 - Read settings from EEPROM
- // ----------------------------------------
+ /*!
+ ### M501 - Read settings from EEPROM M501: Read parameters from EEPROM
+ Set the active parameters to those stored in the EEPROM. This is useful to revert parameters after experimenting with them.
+ */
case 501:
{
Config_RetrieveSettings();
}
break;
- //! ### M502 - Revert all settings to factory default
- // -------------------------------------------------
+ /*!
+ ### M502 - Revert all settings to factory default M502: Restore Default Settings
+ This command resets all tunable parameters to their default values, as set in the firmware's configuration files. This doesn't reset any parameters stored in the EEPROM, so it must be followed by M500 to write the default settings.
+ */
case 502:
{
Config_ResetDefault();
}
break;
- //! ### M503 - Repport all settings currently in memory
- // -------------------------------------------------
+ /*!
+ ### M503 - Repport all settings currently in memory M503: Report Current Settings
+ This command asks the firmware to reply with the current print settings as set in memory. Settings will differ from EEPROM contents if changed since the last load / save. The reply output includes the G-Code commands to produce each setting. For example, Steps-Per-Unit values are displayed as an M92 command.
+ */
case 503:
{
Config_PrintSettings();
}
break;
- //! ### M509 - Force language selection
- // ------------------------------------------------
+ /*!
+ ### M509 - Force language selection M509: Force language selection
+ Resets the language to English.
+ Only on Original Prusa i3 MK2.5/s and MK3/s with multiple languages.
+ */
case 509:
{
lang_reset();
@@ -7157,8 +7704,16 @@ Sigma_Exit:
break;
#ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
- //! ### M540 - Abort print on endstop hit (enable/disable)
- // -----------------------------------------------------
+ /*!
+ ### M540 - Abort print on endstop hit (enable/disable) M540 in Marlin: Enable/Disable "Stop SD Print on Endstop Hit"
+ In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. You must define `ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED`.
+ #### Usage
+
+ M540 [ S ]
+
+ #### Parameters
+ - `S` - disabled=0, enabled=1
+ */
case 540:
{
if(code_seen('S')) abort_on_endstop_hit = code_value() > 0;
@@ -7166,6 +7721,17 @@ Sigma_Exit:
break;
#endif
+ /*!
+ ### M851 - Set Z-Probe Offset M851: Set Z-Probe Offset"
+ Sets the Z-probe Z offset. This offset is used to determine the actual Z position of the nozzle when using a probe to home Z with G28. This value may also be used by G81 (Prusa) / G29 (Marlin) to apply correction to the Z position.
+ This value represents the distance from nozzle to the bed surface at the point where the probe is triggered. This value will be negative for typical switch probes, inductive probes, and setups where the nozzle makes a circuit with a raised metal contact. This setting will be greater than zero on machines where the nozzle itself is used as the probe, pressing down on the bed to press a switch. (This is a common setup on delta machines.)
+ #### Usage
+
+ M851 [ Z ]
+
+ #### Parameters
+ - `Z` - Z offset probe to nozzle.
+ */
#ifdef CUSTOM_M_CODE_SET_Z_PROBE_OFFSET
case CUSTOM_M_CODE_SET_Z_PROBE_OFFSET:
{
@@ -7204,8 +7770,21 @@ Sigma_Exit:
#ifdef FILAMENTCHANGEENABLE
- //! ### M600 - Initiate Filament change procedure
- // --------------------------------------
+ /*!
+ ### M600 - Initiate Filament change procedure M600: Filament change pause
+ Initiates Filament change, it is also used during Filament Runout Sensor process.
+ If the `M600` is triggered under 25mm it will do a Z-lift of 25mm to prevent a filament blob.
+ #### Usage
+
+ M600 [ X | Y | Z | E | L | AUTO ]
+
+ - `X` - X position, default 211
+ - `Y` - Y position, default 0
+ - `Z` - relative lift Z, default 2.
+ - `E` - initial retract, default -2
+ - `L` - later retract distance for removal, default -80
+ - `AUTO` - Automatically (only with MMU)
+ */
case 600: //Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
{
st_synchronize();
@@ -7281,10 +7860,15 @@ Sigma_Exit:
break;
#endif //FILAMENTCHANGEENABLE
- //! ### M25 - Pause SD print
- //! ### M601 - Pause print
- //! ### M125 - Pause print (TODO: not implemented)
- // -------------------------------
+ /*!
+ ### M601 - Pause print M601: Pause print
+ */
+ /*!
+ ### M125 - Pause print (TODO: not implemented)
+ */
+ /*!
+ ### M25 - Pause SD print M25: Pause SD print
+ */
case 25:
case 601:
{
@@ -7297,30 +7881,34 @@ Sigma_Exit:
}
break;
- //! ### M602 - Resume print
- // -------------------------------
+ /*!
+ ### M602 - Resume print M602: Resume print
+ */
case 602: {
if (isPrintPaused)
lcd_resume_print();
}
break;
- //! ### M603 - Stop print
- // -------------------------------
+ /*!
+ ### M603 - Stop print M603: Stop print
+ */
case 603: {
lcd_print_stop();
}
break;
#ifdef PINDA_THERMISTOR
- //! ### M860 - Wait for extruder temperature (PINDA)
- // --------------------------------------------------------------
- /*!
- Wait for PINDA thermistor to reach target temperature
-
- M860 [S]
-
- */
+ /*!
+ ### M860 - Wait for extruder temperature (PINDA) M860 Wait for Probe Temperature
+ Wait for PINDA thermistor to reach target temperature
+ #### Usage
+
+ M860 [ S ]
+
+ #### Parameters
+ - `S` - Target temperature
+ */
case 860:
{
int set_target_pinda = 0;
@@ -7365,17 +7953,20 @@ Sigma_Exit:
break;
}
- //! ### M861 - Set/Get PINDA temperature compensation offsets
- // -----------------------------------------------------------
- /*!
-
- M861 [ ? | ! | Z | S [I] ]
-
- - `?` - Print current EEPROM offset values
- - `!` - Set factory default values
- - `Z` - Set all values to 0 (effectively disabling PINDA temperature compensation)
- - `S` `I` - Set compensation ustep value S for compensation table index I
- */
+ /*!
+ ### M861 - Set/Get PINDA temperature compensation offsets M861 Set Probe Thermal Compensation
+ Set compensation ustep value `S` for compensation table index `I`.
+ #### Usage
+
+ M861 [ ? | ! | Z | S | I ]
+
+ #### Parameters
+ - `?` - Print current EEPROM offset values
+ - `!` - Set factory default values
+ - `Z` - Set all values to 0 (effectively disabling PINDA temperature compensation)
+ - `S` - Microsteps
+ - `I` - Table index
+ */
case 861:
if (code_seen('?')) { // ? - Print out current EEPROM offset values
uint8_t cal_status = calibration_status_pinda();
@@ -7448,38 +8039,40 @@ Sigma_Exit:
#endif //PINDA_THERMISTOR
- //! ### M862 - Print checking
- // ----------------------------------------------
- /*!
- Checks the parameters of the printer and gcode and performs compatibility check
- - M862.1 { P | Q }
- - M862.2 { P | Q }
- - M862.3 { P"" | Q }
- - M862.4 { P | Q }
- - M862.5 { P | Q }
-
- When run with P<> argument, the check is performed against the input value.
- When run with Q argument, the current value is shown.
-
- M862.3 accepts text identifiers of printer types too.
- The syntax of M862.3 is (note the quotes around the type):
-
- M862.3 P "MK3S"
-
- Accepted printer type identifiers and their numeric counterparts:
- - MK1 (100)
- - MK2 (200)
- - MK2MM (201)
- - MK2S (202)
- - MK2SMM (203)
- - MK2.5 (250)
- - MK2.5MMU2 (20250)
- - MK2.5S (252)
- - MK2.5SMMU2S (20252)
- - MK3 (300)
- - MK3MMU2 (20300)
- - MK3S (302)
- - MK3SMMU2S (20302)
+ /*!
+ ### M862 - Print checking M862: Print checking
+ Checks the parameters of the printer and gcode and performs compatibility check
+
+ - M862.1 { P | Q } 0.25/0.40/0.60
+ - M862.2 { P | Q }
+ - M862.3 { P"" | Q }
+ - M862.4 { P | Q }
+ - M862.5 { P | Q }
+
+ When run with P<> argument, the check is performed against the input value.
+ When run with Q argument, the current value is shown.
+
+ M862.3 accepts text identifiers of printer types too.
+ The syntax of M862.3 is (note the quotes around the type):
+
+ M862.3 P "MK3S"
+
+ Accepted printer type identifiers and their numeric counterparts:
+
+ - MK1 (100)
+ - MK2 (200)
+ - MK2MM (201)
+ - MK2S (202)
+ - MK2SMM (203)
+ - MK2.5 (250)
+ - MK2.5MMU2 (20250)
+ - MK2.5S (252)
+ - MK2.5SMMU2S (20252)
+ - MK3 (300)
+ - MK3MMU2 (20300)
+ - MK3S (302)
+ - MK3SMMU2S (20302)
+
*/
case 862: // M862: print checking
float nDummy;
@@ -7541,19 +8134,44 @@ Sigma_Exit:
break;
#ifdef LIN_ADVANCE
- //! ### M900 - Set Linear advance options
- // ----------------------------------------------
+ /*!
+ ### M900 - Set Linear advance options M900 Set Linear Advance Scaling Factors
+ Sets the advance extrusion factors for Linear Advance. If any of the R, W, H, or D parameters are set to zero the ratio will be computed dynamically during printing.
+ #### Usage
+
+ M900 [ K | R | W | H | D]
+
+ #### Parameters
+ - `K` - Advance K factor
+ - `R` - Set ratio directly (overrides WH/D)
+ - `W` - Width
+ - `H` - Height
+ - `D` - Diameter Set ratio from WH/D
+ */
case 900:
gcode_M900();
break;
#endif
- //! ### M907 - Set digital trimpot motor current in mA using axis codes
- // ---------------------------------------------------------------
+ /*!
+ ### M907 - Set digital trimpot motor current in mA using axis codes M907: Set digital trimpot motor
+ Set digital trimpot motor current using axis codes (X, Y, Z, E, B, S).
+ #### Usage
+
+ M907 [ X | Y | Z | E | B | S ]
+
+ #### Parameters
+ - `X` - X motor driver
+ - `Y` - Y motor driver
+ - `Z` - Z motor driver
+ - `E` - Extruder motor driver
+ - `B` - Second Extruder motor driver
+ - `S` - All motors
+ */
case 907:
{
#ifdef TMC2130
- //! See tmc2130_cur2val() for translation to 0 .. 63 range
+ // See tmc2130_cur2val() for translation to 0 .. 63 range
for (int i = 0; i < NUM_AXIS; i++)
if(code_seen(axis_codes[i]))
{
@@ -7583,8 +8201,17 @@ Sigma_Exit:
}
break;
- //! ### M908 - Control digital trimpot directly
- // ---------------------------------------------------------
+ /*!
+ ### M908 - Control digital trimpot directly M908: Control digital trimpot directly
+ In Prusa Firmware this G-code is deactivated by default, must be turned on in the source code. Not usable on Prusa printers.
+ #### Usage
+
+ M908 [ P | S ]
+
+ #### Parameters
+ - `P` - channel
+ - `S` - current
+ */
case 908:
{
#if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1
@@ -7598,16 +8225,30 @@ Sigma_Exit:
#ifdef TMC2130_SERVICE_CODES_M910_M918
- //! ### M910 - TMC2130 init
- // -----------------------------------------------
+ /*!
+ ### M910 - TMC2130 init M910: TMC2130 init
+ Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code.
+
+ */
case 910:
{
tmc2130_init();
}
break;
- //! ### M911 - Set TMC2130 holding currents
- // -------------------------------------------------
+ /*!
+ ### M911 - Set TMC2130 holding currents M911: Set TMC2130 holding currents
+ Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code.
+ #### Usage
+
+ M911 [ X | Y | Z | E ]
+
+ #### Parameters
+ - `X` - X stepper driver holding current value
+ - `Y` - Y stepper driver holding current value
+ - `Z` - Z stepper driver holding current value
+ - `E` - Extruder stepper driver holding current value
+ */
case 911:
{
if (code_seen('X')) tmc2130_set_current_h(0, code_value());
@@ -7617,8 +8258,19 @@ Sigma_Exit:
}
break;
- //! ### M912 - Set TMC2130 running currents
- // -----------------------------------------------
+ /*!
+ ### M912 - Set TMC2130 running currents M912: Set TMC2130 running currents
+ Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code.
+ #### Usage
+
+ M912 [ X | Y | Z | E ]
+
+ #### Parameters
+ - `X` - X stepper driver running current value
+ - `Y` - Y stepper driver running current value
+ - `Z` - Z stepper driver running current value
+ - `E` - Extruder stepper driver running current value
+ */
case 912:
{
if (code_seen('X')) tmc2130_set_current_r(0, code_value());
@@ -7628,17 +8280,22 @@ Sigma_Exit:
}
break;
- //! ### M913 - Print TMC2130 currents
- // -----------------------------
+ /*!
+ ### M913 - Print TMC2130 currents M913: Print TMC2130 currents
+ Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code.
+ Shows TMC2130 currents.
+ */
case 913:
{
tmc2130_print_currents();
}
break;
- //! ### M914 - Set TMC2130 normal mode
- // ------------------------------
- case 914:
+ /*!
+ ### M914 - Set TMC2130 normal mode M914: Set TMC2130 normal mode
+ Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code.
+ */
+ case 914:
{
tmc2130_mode = TMC2130_MODE_NORMAL;
update_mode_profile();
@@ -7646,9 +8303,11 @@ Sigma_Exit:
}
break;
- //! ### M95 - Set TMC2130 silent mode
- // ------------------------------
- case 915:
+ /*!
+ ### M915 - Set TMC2130 silent mode M915: Set TMC2130 silent mode
+ Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code.
+ */
+ case 915:
{
tmc2130_mode = TMC2130_MODE_SILENT;
update_mode_profile();
@@ -7656,8 +8315,19 @@ Sigma_Exit:
}
break;
- //! ### M916 - Set TMC2130 Stallguard sensitivity threshold
- // -------------------------------------------------------
+ /*!
+ ### M916 - Set TMC2130 Stallguard sensitivity threshold M916: Set TMC2130 Stallguard sensitivity threshold
+ Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code.
+ #### Usage
+
+ M916 [ X | Y | Z | E ]
+
+ #### Parameters
+ - `X` - X stepper driver stallguard sensitivity threshold value
+ - `Y` - Y stepper driver stallguard sensitivity threshold value
+ - `Z` - Z stepper driver stallguard sensitivity threshold value
+ - `E` - Extruder stepper driver stallguard sensitivity threshold value
+ */
case 916:
{
if (code_seen('X')) tmc2130_sg_thr[X_AXIS] = code_value();
@@ -7669,8 +8339,19 @@ Sigma_Exit:
}
break;
- //! ### M917 - Set TMC2130 PWM amplitude offset (pwm_ampl)
- // --------------------------------------------------------------
+ /*!
+ ### M917 - Set TMC2130 PWM amplitude offset (pwm_ampl) M917: Set TMC2130 PWM amplitude offset (pwm_ampl)
+ Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code.
+ #### Usage
+
+ M917 [ X | Y | Z | E ]
+
+ #### Parameters
+ - `X` - X stepper driver PWM amplitude offset value
+ - `Y` - Y stepper driver PWM amplitude offset value
+ - `Z` - Z stepper driver PWM amplitude offset value
+ - `E` - Extruder stepper driver PWM amplitude offset value
+ */
case 917:
{
if (code_seen('X')) tmc2130_set_pwm_ampl(0, code_value());
@@ -7680,8 +8361,19 @@ Sigma_Exit:
}
break;
- //! ### M918 - Set TMC2130 PWM amplitude gradient (pwm_grad)
- // -------------------------------------------------------------
+ /*!
+ ### M918 - Set TMC2130 PWM amplitude gradient (pwm_grad) M918: Set TMC2130 PWM amplitude gradient (pwm_grad)
+ Not active in default, only if `TMC2130_SERVICE_CODES_M910_M918` is defined in source code.
+ #### Usage
+
+ M918 [ X | Y | Z | E ]
+
+ #### Parameters
+ - `X` - X stepper driver PWM amplitude gradient value
+ - `Y` - Y stepper driver PWM amplitude gradient value
+ - `Z` - Z stepper driver PWM amplitude gradient value
+ - `E` - Extruder stepper driver PWM amplitude gradient value
+ */
case 918:
{
if (code_seen('X')) tmc2130_set_pwm_grad(0, code_value());
@@ -7693,9 +8385,24 @@ Sigma_Exit:
#endif //TMC2130_SERVICE_CODES_M910_M918
- //! ### M350 - Set microstepping mode
- // ---------------------------------------------------
- //! Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers.
+ /*!
+ ### M350 - Set microstepping mode M350: Set microstepping mode
+ Printers with TMC2130 drivers have `X`, `Y`, `Z` and `E` as options. The steps-per-unit value is updated accordingly. Not all resolutions are valid!
+ Printers without TMC2130 drivers also have `B` and `S` options. In this case, the steps-per-unit value in not changed!
+ #### Usage
+
+ M350 [ X | Y | Z | E | B | S ]
+
+ #### Parameters
+ - `X` - X new resolution
+ - `Y` - Y new resolution
+ - `Z` - Z new resolution
+ - `E` - E new resolution
+
+ Only valid for MK2.5(S) or printers without TMC2130 drivers
+ - `B` - Second extruder new resolution
+ - `S` - All axes new resolution
+ */
case 350:
{
#ifdef TMC2130
@@ -7740,11 +8447,21 @@ Sigma_Exit:
}
break;
- //! ### M351 - Toggle Microstep Pins
- // -----------------------------------
- //! Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low.
- //!
- //! M351 [B<0|1>] [E<0|1>] S<1|2> [X<0|1>] [Y<0|1>] [Z<0|1>]
+ /*!
+ ### M351 - Toggle Microstep Pins M351: Toggle MS1 MS2 pins directly
+ Toggle MS1 MS2 pins directly.
+ #### Usage
+
+ M351 [B<0|1>] [E<0|1>] S<1|2> [X<0|1>] [Y<0|1>] [Z<0|1>]
+
+ #### Parameters
+ - `X` - Update X axis
+ - `Y` - Update Y axis
+ - `Z` - Update Z axis
+ - `E` - Update E axis
+ - `S` - which MSx pin to toggle
+ - `B` - new pin value
+ */
case 351:
{
#if defined(X_MS1_PIN) && X_MS1_PIN > -1
@@ -7764,8 +8481,10 @@ Sigma_Exit:
}
break;
- //! ### M701 - Load filament
- // -------------------------
+ /*!
+ ### M701 - Load filament M701: Load filament
+
+ */
case 701:
{
if (mmu_enabled && code_seen('E'))
@@ -7774,16 +8493,17 @@ Sigma_Exit:
}
break;
- //! ### M702 - Unload filament
- // ------------------------
- /*!
-
- M702 [U C]
-
- - `U` Unload all filaments used in current print
- - `C` Unload just current filament
- - without any parameters unload all filaments
- */
+ /*!
+ ### M702 - Unload filament G32: Undock Z Probe sled
+ #### Usage
+
+ M702 [ U | C ]
+
+ #### Parameters
+ - `U` - Unload all filaments used in current print
+ - `C` - Unload just current filament
+ - without any parameters unload all filaments
+ */
case 702:
{
#ifdef SNMM
@@ -7806,14 +8526,19 @@ Sigma_Exit:
}
break;
- //! ### M999 - Restart after being stopped
- // ------------------------------------
+ /*!
+ ### M999 - Restart after being stopped M999: Restart after being stopped by error
+ @todo Usually doesn't work. Should be fixed or removed. Most of the time, if `Stopped` it set, the print fails and is unrecoverable.
+ */
case 999:
Stopped = false;
lcd_reset_alert_level();
gcode_LastN = Stopped_gcode_LastN;
FlushSerialRequestResend();
break;
+ /*!
+ #### End of M-Commands
+ */
default:
printf_P(PSTR("Unknown M code: %s \n"), cmdbuffer + bufindr + CMDHDRSIZE);
}
@@ -7822,19 +8547,16 @@ Sigma_Exit:
}
}
// end if(code_seen('M')) (end of M codes)
-
- //! -----------------------------------------------------------------------------------------
- //! T Codes
- //!
- //! T - select extruder in case of multi extruder printer
- //! select filament in case of MMU_V2
- //! if extruder is "?", open menu to let the user select extruder/filament
- //!
- //! For MMU_V2:
- //! @n T Gcode to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels.
- //! @n T? Gcode to extrude shouldn't have to follow, load to extruder wheels is done automatically
- //! @n Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load.
- //! @n Tc Load to nozzle after filament was prepared by Tc and extruder nozzle is already heated.
+ /*!
+ -----------------------------------------------------------------------------------------
+ # T Codes
+ T - select extruder in case of multi extruder printer. select filament in case of MMU_V2.
+ #### For MMU_V2:
+ T Gcode to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels.
+ @n T? Gcode to extrude shouldn't have to follow, load to extruder wheels is done automatically
+ @n Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load.
+ @n Tc Load to nozzle after filament was prepared by Tc and extruder nozzle is already heated.
+ */
else if(code_seen('T'))
{
int index;
@@ -8011,95 +8733,197 @@ Sigma_Exit:
}
}
} // end if(code_seen('T')) (end of T codes)
+ /*!
+ #### End of T-Codes
+ */
- //! ----------------------------------------------------------------------------------------------
-
+ /**
+ *---------------------------------------------------------------------------------
+ *# D codes
+ */
else if (code_seen('D')) // D codes (debug)
{
switch((int)code_value())
{
- //! ### D-1 - Endless loop
- // -------------------
+ /*!
+ ### D-1 - Endless Loop D-1: Endless Loop
+ */
case -1:
dcode__1(); break;
#ifdef DEBUG_DCODES
- //! ### D0 - Reset
- // --------------
+ /*!
+ ### D0 - Reset D0: Reset
+ #### Usage
+
+ D0 [ B ]
+
+ #### Parameters
+ - `B` - Bootloader
+ */
case 0:
dcode_0(); break;
- //! ### D1 - Clear EEPROM
- // ------------------
+ /*!
+ *
+ ### D1 - Clear EEPROM and RESET D1: Clear EEPROM and RESET
+
+ D1
+
+ *
+ */
case 1:
dcode_1(); break;
- //! ### D2 - Read/Write RAM
- // --------------------
+ /*!
+ ### D2 - Read/Write RAM D3: Read/Write RAM
+ This command can be used without any additional parameters. It will read the entire RAM.
+ #### Usage
+
+ D3 [ A | C | X ]
+
+ #### Parameters
+ - `A` - Address (0x0000-0x1fff)
+ - `C` - Count (0x0001-0x2000)
+ - `X` - Data
+ */
case 2:
dcode_2(); break;
#endif //DEBUG_DCODES
#ifdef DEBUG_DCODE3
- //! ### D3 - Read/Write EEPROM
- // -----------------------
+ /*!
+ ### D3 - Read/Write EEPROM D3: Read/Write EEPROM
+ This command can be used without any additional parameters. It will read the entire eeprom.
+ #### Usage
+
+ D3 [ A | C | X ]
+
+ #### Parameters
+ - `A` - Address (0x0000-0x0fff)
+ - `C` - Count (0x0001-0x1000)
+ - `X` - Data
+ */
case 3:
dcode_3(); break;
#endif //DEBUG_DCODE3
#ifdef DEBUG_DCODES
- //! ### D4 - Read/Write PIN
- // ---------------------
+ /*!
+
+ ### D4 - Read/Write PIN D4: Read/Write PIN
+ To read the digital value of a pin you need only to define the pin number.
+ #### Usage
+
+ D4 [ P | F | V ]
+
+ #### Parameters
+ - `P` - Pin (0-255)
+ - `F` - Function in/out (0/1)
+ - `V` - Value (0/1)
+ */
case 4:
dcode_4(); break;
#endif //DEBUG_DCODES
#ifdef DEBUG_DCODE5
- //! ### D5 - Read/Write FLASH
- // ------------------------
+ /*!
+ ### D5 - Read/Write FLASH D5: Read/Write Flash
+ This command can be used without any additional parameters. It will read the 1kb FLASH.
+ #### Usage
+
+ D3 [ A | C | X | E ]
+
+ #### Parameters
+ - `A` - Address (0x00000-0x3ffff)
+ - `C` - Count (0x0001-0x2000)
+ - `X` - Data
+ - `E` - Erase
+ */
case 5:
dcode_5(); break;
break;
#endif //DEBUG_DCODE5
#ifdef DEBUG_DCODES
- //! ### D6 - Read/Write external FLASH
- // ---------------------------------------
+ /*!
+ ### D6 - Read/Write external FLASH D6: Read/Write external Flash
+ Reserved
+ */
case 6:
dcode_6(); break;
- //! ### D7 - Read/Write Bootloader
- // -------------------------------
+ /*!
+ ### D7 - Read/Write Bootloader D7: Read/Write Bootloader
+ Reserved
+ */
case 7:
dcode_7(); break;
- //! ### D8 - Read/Write PINDA
- // ---------------------------
+ /*!
+ ### D8 - Read/Write PINDA D8: Read/Write PINDA
+ #### Usage
+
+ D8 [ ? | ! | P | Z ]
+
+ #### Parameters
+ - `?` - Read PINDA temperature shift values
+ - `!` - Reset PINDA temperature shift values to default
+ - `P` - Pinda temperature [C]
+ - `Z` - Z Offset [mm]
+ */
case 8:
dcode_8(); break;
- // ### D9 - Read/Write ADC
- // ------------------------
+ /*!
+ ### D9 - Read ADC D9: Read ADC
+ #### Usage
+
+ D9 [ I | V ]
+
+ #### Parameters
+ - `I` - ADC channel index
+ - `0` - Heater 0 temperature
+ - `1` - Heater 1 temperature
+ - `2` - Bed temperature
+ - `3` - PINDA temperature
+ - `4` - PWR voltage
+ - `5` - Ambient temperature
+ - `6` - BED voltage
+ - `V` Value to be written as simulated
+ */
case 9:
dcode_9(); break;
- //! ### D10 - XYZ calibration = OK
- // ------------------------------
+ /*!
+ ### D10 - Set XYZ calibration = OK D10: Set XYZ calibration = OK
+ */
case 10:
dcode_10(); break;
+
+ /*!
+ ### D12 - Time D12: Time
+ Writes the actual time in the log file.
+ */
+
#endif //DEBUG_DCODES
#ifdef HEATBED_ANALYSIS
- //! ### D80 - Bed check
- // ---------------------
- /*!
- - `E` - dimension x
- - `F` - dimention y
- - `G` - points_x
- - `H` - points_y
- - `I` - offset_x
- - `J` - offset_y
+ /*!
+ ### D80 - Bed check D80: Bed check
+ This command will log data to SD card file "mesh.txt".
+ #### Usage
+
+ D80 [ E | F | G | H | I | J ]
+
+ #### Parameters
+ - `E` - Dimension X (default 40)
+ - `F` - Dimention Y (default 40)
+ - `G` - Points X (default 40)
+ - `H` - Points Y (default 40)
+ - `I` - Offset X (default 74)
+ - `J` - Offset Y (default 34)
*/
case 80:
{
@@ -8125,15 +8949,20 @@ Sigma_Exit:
bed_check(dimension_x,dimension_y,points_x,points_y,offset_x,offset_y);
}break;
- //! ### D81 - Bed analysis
- // -----------------------------
- /*!
- - `E` - dimension x
- - `F` - dimention y
- - `G` - points_x
- - `H` - points_y
- - `I` - offset_x
- - `J` - offset_y
+ /*!
+ ### D81 - Bed analysis D80: Bed analysis
+ This command will log data to SD card file "wldsd.txt".
+ #### Usage
+
+ D81 [ E | F | G | H | I | J ]
+
+ #### Parameters
+ - `E` - Dimension X (default 40)
+ - `F` - Dimention Y (default 40)
+ - `G` - Points X (default 40)
+ - `H` - Points Y (default 40)
+ - `I` - Offset X (default 74)
+ - `J` - Offset Y (default 34)
*/
case 81:
{
@@ -8158,8 +8987,9 @@ Sigma_Exit:
#endif //HEATBED_ANALYSIS
#ifdef DEBUG_DCODES
- //! ### D106 print measured fan speed for different pwm values
- // --------------------------------------------------------------
+ /*!
+ ### D106 - Print measured fan speed for different pwm values D106: Print measured fan speed for different pwm values
+ */
case 106:
{
for (int i = 255; i > 0; i = i - 5) {
@@ -8174,42 +9004,61 @@ Sigma_Exit:
}break;
#ifdef TMC2130
- //! ### D2130 - TMC2130 Trinamic stepper controller
- // ---------------------------
-
-
- /*!
-
-
- D2130[subcommand][value]
-
- - :
- - '0' current off
- - '1' current on
- - '+' single step
- - * value sereval steps
- - '-' dtto oposite direction
- - '?' read register
- - * "mres"
- - * "step"
- - * "mscnt"
- - * "mscuract"
- - * "wave"
- - '!' set register
- - * "mres"
- - * "step"
- - * "wave"
- - '@' home calibrate axis
-
- Example:
-
- D2130E?wave ... print extruder microstep linearity compensation curve
-
- D2130E!wave0 ... disable extruder linearity compensation curve, (sine curve is used)
-
- D2130E!wave220 ... (sin(x))^1.1 extruder microstep compensation curve used
- */
-
+ /*!
+ ### D2130 - Trinamic stepper controller D2130: Trinamic stepper controller
+ @todo Please review by owner of the code. RepRap Wiki Gcode needs to be updated after review of owner as well.
+
+ #### Usage
+
+ D2130 [ Axis | Command | Subcommand | Value ]
+
+ #### Parameters
+ - Axis
+ - `X` - X stepper driver
+ - `Y` - Y stepper driver
+ - `Z` - Z stepper driver
+ - `E` - Extruder stepper driver
+ - Commands
+ - `0` - Current off
+ - `1` - Current on
+ - `+` - Single step
+ - `-` - Single step oposite direction
+ - `NNN` - Value sereval steps
+ - `?` - Read register
+ - Subcommands for read register
+ - `mres` - Micro step resolution. More information in datasheet '5.5.2 CHOPCONF – Chopper Configuration'
+ - `step` - Step
+ - `mscnt` - Microstep counter. More information in datasheet '5.5 Motor Driver Registers'
+ - `mscuract` - Actual microstep current for motor. More information in datasheet '5.5 Motor Driver Registers'
+ - `wave` - Microstep linearity compensation curve
+ - `!` - Set register
+ - Subcommands for set register
+ - `mres` - Micro step resolution
+ - `step` - Step
+ - `wave` - Microstep linearity compensation curve
+ - Values for set register
+ - `0, 180 --> 250` - Off
+ - `0.9 --> 1.25` - Valid values (recommended is 1.1)
+ - `@` - Home calibrate axis
+
+ Examples:
+
+ D2130E?wave
+
+ Print extruder microstep linearity compensation curve
+
+ D2130E!wave0
+
+ Disable extruder linearity compensation curve, (sine curve is used)
+
+ D2130E!wave220
+
+ (sin(x))^1.1 extruder microstep compensation curve used
+
+ Notes:
+ For more information see https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2130_datasheet.pdf
+ *
+ */
case 2130:
dcode_2130(); break;
@@ -8217,8 +9066,20 @@ Sigma_Exit:
#if (defined (FILAMENT_SENSOR) && defined(PAT9125))
- //! ### D9125 - FILAMENT_SENSOR
- // ---------------------------------
+ /*!
+ ### D9125 - PAT9125 filament sensor D9125: PAT9125 filament sensor
+ #### Usage
+
+ D9125 [ ? | ! | R | X | Y | L ]
+
+ #### Parameters
+ - `?` - Print values
+ - `!` - Print values
+ - `R` - Resolution. Not active in code
+ - `X` - X values
+ - `Y` - Y values
+ - `L` - Activate filament sensor log
+ */
case 9125:
dcode_9125(); break;
#endif //FILAMENT_SENSOR
@@ -8238,7 +9099,9 @@ Sigma_Exit:
ClearToSend();
}
-
+/*!
+#### End of D-Codes
+*/
/** @defgroup GCodes G-Code List
*/