diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 8ac1aaf5..0e5850b9 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3256,14 +3256,19 @@ extern uint8_t st_backlash_x; extern uint8_t st_backlash_y; #endif //BACKLASH_Y +//! \ingroup marlin_main + //! @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 //! -//! Implemented Codes +//! +//! Implemented Codes //! ------------------- //! +//! * _This list is not updated. Current documentation is maintained inside the process_cmd function._ +//! //!@n PRUSA CODES //!@n P F - Returns FW versions //!@n P R - Returns revision of printer @@ -3386,6 +3391,15 @@ extern uint8_t st_backlash_y; //! //!@n M928 - Start SD logging (M928 filename.g) - ended by M29 //!@n M999 - Restart after being stopped by error +//!

+ +/** @defgroup marlin_main Marlin main */ + +/** \ingroup GCodes */ + +//! _This is a list of currently implemented G Codes in Prusa firmware (dynamically generated from doxygen)_ + + void process_commands() { #ifdef FANCHECK @@ -3444,21 +3458,33 @@ void process_commands() #ifdef TMC2130 else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("CRASH_"), 6) == 0) { - if(code_seen("CRASH_DETECTED")) //! CRASH_DETECTED + + //! ### CRASH_DETECTED - TMC2130 + // --------------------------------- + if(code_seen("CRASH_DETECTED")) { uint8_t mask = 0; if (code_seen('X')) mask |= X_AXIS_MASK; if (code_seen('Y')) mask |= Y_AXIS_MASK; crashdet_detected(mask); } - else if(code_seen("CRASH_RECOVER")) //! CRASH_RECOVER + + //! ### CRASH_RECOVER - TMC2130 + // ---------------------------------- + else if(code_seen("CRASH_RECOVER")) crashdet_recover(); - else if(code_seen("CRASH_CANCEL")) //! CRASH_CANCEL + + //! ### CRASH_CANCEL - TMC2130 + // ---------------------------------- + else if(code_seen("CRASH_CANCEL")) crashdet_cancel(); } else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("TMC_"), 4) == 0) { - if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_WAVE_"), 9) == 0) //! TMC_SET_WAVE_ + + //! ### TMC_SET_WAVE_ + // -------------------- + if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_WAVE_"), 9) == 0) { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); axis = (axis == 'E')?3:(axis - 'X'); @@ -3468,7 +3494,10 @@ void process_commands() tmc2130_set_wave(axis, 247, fac); } } - else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_STEP_"), 9) == 0) //! TMC_SET_STEP_ + + //! ### TMC_SET_STEP_ + // ------------------ + else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_STEP_"), 9) == 0) { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); axis = (axis == 'E')?3:(axis - 'X'); @@ -3479,7 +3508,10 @@ void process_commands() tmc2130_goto_step(axis, step & (4*res - 1), 2, 1000, res); } } - else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_CHOP_"), 9) == 0) //! TMC_SET_CHOP_ + + //! ### TMC_SET_CHOP_ + // ------------------- + else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_CHOP_"), 9) == 0) { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); axis = (axis == 'E')?3:(axis - 'X'); @@ -3530,19 +3562,50 @@ void process_commands() } #endif //BACKLASH_Y #endif //TMC2130 - else if(code_seen("PRUSA")){ - if (code_seen("Ping")) { //! PRUSA Ping + else if(code_seen("PRUSA")){ + /*! + * + ### PRUSA - Internal command set + + Set of internal PRUSA commands + + PRUSA [ Ping | PRN | FAN | fn | thx | uvlo | fsensor_recover | MMURES | RESET | fv | M28 | SN | Fir | Rev | Lang | Lz | Beat | FR ] + + - `Ping` + - `PRN` - Prints revision of the printer + - `FAN` - Prints fan details + - `fn` - Prints farm no. + - `thx` + - `uvlo` + - `fsensor_recover` - Filament sensor recover - restore print and continue + - `MMURES` - Reset MMU + - `RESET` - (Careful!) + - `fv` - ? + - `M28` + - `SN` + - `Fir` - Prints firmware version + - `Rev`- Prints filament size, elelectronics, nozzle type + - `Lang` - Reset the language + - `Lz` + - `Beat` - Kick farm link timer + - `FR` - Full factory reset + - `nozzle D G1 case 1: // G1 if(Stopped == false) { @@ -3907,19 +3973,30 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) //ClearToSend(); } break; - case 2: // G2 - CW ARC + + //! ### G2 - CW ARC + // ------------------------------ + case 2: if(Stopped == false) { get_arc_coordinates(); prepare_arc_move(true); } break; - case 3: // G3 - CCW ARC + + + //! ### G3 - CCW ARC + // ------------------------------- + case 3: if(Stopped == false) { get_arc_coordinates(); prepare_arc_move(false); } break; - case 4: // G4 dwell + + + //! ### G4 - Dwell + // ------------------------------- + case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait @@ -3934,7 +4011,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; #ifdef FWRETRACT - case 10: // G10 retract + + + //! ### G10 Retract + // ------------------------------ + case 10: #if EXTRUDERS > 1 retracted_swap[active_extruder]=(code_seen('S') && code_value_long() == 1); // checks for swap retract argument retract(true,retracted_swap[active_extruder]); @@ -3942,7 +4023,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) retract(true); #endif break; - case 11: // G11 retract_recover + + + //! ### G11 - Retract recover + // ----------------------------- + case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else @@ -3950,7 +4035,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #endif break; #endif //FWRETRACT - case 28: //G28 Home all Axis one at a time + + + //! ### G28 - Home all Axis one at a time + // -------------------------------------------- + case 28: { long home_x_value = 0; long home_y_value = 0; @@ -3977,8 +4066,13 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; } + #ifdef ENABLE_AUTO_BED_LEVELING - case 29: // G29 Detailed Z-Probe, probes the bed at 3 or more points. + + + //! ### G29 - Detailed Z-Probe + // -------------------------------- + case 29: { #if Z_MIN_PIN == -1 #error "You must have a Z_MIN endstop in order to enable Auto Bed Leveling feature! Z_MIN_PIN must point to a valid hardware pin." @@ -4121,7 +4215,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; #ifndef Z_PROBE_SLED - case 30: // G30 Single Z Probe + + //! ### G30 - Single Z Probe + // ------------------------------------ + case 30: { st_synchronize(); // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly @@ -4143,17 +4240,27 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; #else - case 31: // dock the sled + + //! ### G31 - Dock the sled + // --------------------------- + case 31: dock_sled(true); break; - case 32: // undock the sled + + + //! ### G32 - Undock the sled + // ---------------------------- + case 32: dock_sled(false); break; #endif // Z_PROBE_SLED #endif // ENABLE_AUTO_BED_LEVELING #ifdef MESH_BED_LEVELING - case 30: // G30 Single Z Probe + + //! ### G30 - Single Z Probe + // ---------------------------- + case 30: { st_synchronize(); // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly @@ -4169,7 +4276,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - + //! ### G75 - Print temperature interpolation + // --------------------------------------------- case 75: { for (int i = 40; i <= 110; i++) @@ -4177,7 +4285,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - case 76: //! G76 - PINDA probe temperature calibration + //! ### G76 - PINDA probe temperature calibration + // ------------------------------------------------ + case 76: { #ifdef PINDA_THERMISTOR if (true) @@ -4434,18 +4544,16 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; - - /** - * G80: Mesh-based Z probe, probes a grid and produces a - * mesh to compensate for variable bed height - * + //! ### G80 - Mesh-based Z probe + // ----------------------------------- + + /* + * Probes a grid and produces a mesh to compensate for variable bed height * The S0 report the points as below - * @code{.unparsed} * +----> X-axis * | * | * v Y-axis - * @endcode */ case 80: @@ -4869,8 +4977,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - /** - * G81: Print mesh bed leveling status and bed profile if activated + //! ### G81 - Mesh bed leveling status + // ----------------------------------------- + + /* + * Prints mesh bed leveling status and bed profile if activated */ case 81: if (mbl.active) { @@ -4894,7 +5005,7 @@ 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! @@ -4910,7 +5021,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) SERIAL_PROTOCOLPGM("\n"); break; - /** + /* * G83: Prusa3D specific: Babystep in Z and store to EEPROM */ case 83: @@ -4935,7 +5046,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - /** + /* * G84: Prusa3D specific: UNDO Babystep Z (move Z axis back) */ case 84: @@ -4943,7 +5054,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) // babystepLoadZ = 0; break; - /** + /* * G85: Prusa3D specific: Pick best babystep */ case 85: @@ -4951,38 +5062,58 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; #endif - /** - * G86: Prusa3D specific: Disable babystep correction after home. - * This G-code will be performed at the start of a calibration script. - */ + /** + * ### 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: Prusa3D specific: Enable babystep correction after home - * This G-code will be performed at the end of a calibration script. - */ + + + /** + * ### 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: Prusa3D specific: Don't know what it is for, it is in V2Calibration.gcode - */ + + /** + * ### G88 - Reserved + * + * Currently has no effect. + */ + + // Prusa3D specific: Don't know what it is for, it is in V2Calibration.gcode + case 88: break; #endif // ENABLE_MESH_BED_LEVELING - - case 90: // G90 + //! ### G90 - Switch off relative mode + // ------------------------------- + case 90: relative_mode = false; break; - case 91: // G91 + + //! ### G91 - Switch on relative mode + // ------------------------------- + case 91: relative_mode = true; break; - case 92: // G92 + + //! ### G92 - Set position + // ----------------------------- + case 92: if(!code_seen(axis_codes[E_AXIS])) st_synchronize(); for(int8_t i=0; i < NUM_AXIS; i++) { @@ -4999,7 +5130,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } break; - case 98: //! G98 (activate farm mode) + + //! ### G98 - Activate farm mode + // ----------------------------------- + case 98: farm_mode = 1; PingTime = _millis(); eeprom_update_byte((unsigned char *)EEPROM_FARM_MODE, farm_mode); @@ -5009,7 +5143,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) fCheckModeInit(); // alternatively invoke printer reset break; - case 99: //! G99 (deactivate farm mode) + //! ### G99 - Deactivate farm mode + // ------------------------------------- + case 99: farm_mode = 0; lcd_printer_connected(); eeprom_update_byte((unsigned char *)EEPROM_FARM_MODE, farm_mode); @@ -5023,6 +5159,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) gcode_in_progress = 0; } // end if(code_seen('G')) + + //! --------------------------------------------------------------------------------- + else if(code_seen('M')) { @@ -5041,6 +5180,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) switch(mcode_in_progress) { + //! ### M0, M1 - Stop the printer + // --------------------------------------------------------------- case 0: // M0 - Unconditional stop - Wait for user button press on LCD case 1: // M1 - Conditional stop - Wait for user button press on LCD { @@ -5088,6 +5229,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) LCD_MESSAGERPGM(_T(WELCOME_MSG)); } break; + + //! ### M17 - Enable axes + // --------------------------------- case 17: LCD_MESSAGERPGM(_i("No move."));////MSG_NO_MOVE enable_x(); @@ -5099,44 +5243,68 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) break; #ifdef SDSUPPORT - case 20: // M20 - list SD card + + //! ### M20 - SD Card file list + // ----------------------------------- + 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; - case 21: // M21 - init SD card + //! ### M21 - Init SD card + // ------------------------------------ + case 21: card.initsd(); - break; - case 22: //M22 - release SD card + + //! ### M22 - Release SD card + // ----------------------------------- + case 22: card.release(); - break; - case 23: //M23 - Select file + + //! ### M23 - Select file + // ----------------------------------- + case 23: starpos = (strchr(strchr_pointer + 4,'*')); if(starpos!=NULL) *(starpos)='\0'; card.openFile(strchr_pointer + 4,true); break; - case 24: //M24 - Start SD print + + //! ### M24 - Start SD print + // ---------------------------------- + case 24: if (!card.paused) failstats_reset_print(); card.startFileprint(); starttime=_millis(); break; - case 25: //M25 - Pause SD print + + //! ### M25 - Pause SD print + // ---------------------------------- + case 25: card.pauseSDPrint(); break; - case 26: //M26 - Set SD index + + //! ### M26 - Set SD index + // ---------------------------------- + case 26: if(card.cardOK && code_seen('S')) { card.setIndex(code_value_long()); } break; - case 27: //M27 - Get SD status + + //! ### M27 - Get SD status + // ---------------------------------- + case 27: card.getStatus(); break; - case 28: //M28 - Start SD write + + //! ### M28 - Start SD write + // --------------------------------- + case 28: starpos = (strchr(strchr_pointer + 4,'*')); if(starpos != NULL){ char* npos = strchr(CMDBUFFER_CURRENT_STRING, 'N'); @@ -5145,11 +5313,18 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } card.openFile(strchr_pointer+4,false); break; - case 29: //M29 - Stop SD write + + //! ### M29 - Stop SD write + // ------------------------------------- + //! Currently has no effect. + case 29: //processed in write to file routine above //card,saving = false; break; - case 30: //M30 Delete File + + //! ### M30 - Delete file + // ---------------------------------- + case 30: if (card.cardOK){ card.closefile(); starpos = (strchr(strchr_pointer + 4,'*')); @@ -5161,7 +5336,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) card.removeFile(strchr_pointer + 4); } break; - case 32: //M32 - Select file and start SD print + + //! ### M32 - Select file and start SD print + // ------------------------------------ + case 32: { if(card.sdprinting) { st_synchronize(); @@ -5196,7 +5374,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) starttime=_millis(); //procedure calls count as normal print time. } } break; - case 928: //M928 - Start SD write + + //! ### M982 - Start SD write + // --------------------------------- + case 928: starpos = (strchr(strchr_pointer + 5,'*')); if(starpos != NULL){ char* npos = strchr(CMDBUFFER_CURRENT_STRING, 'N'); @@ -5208,6 +5389,8 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #endif //SDSUPPORT + //! ### M31 - Report current print time + // -------------------------------------------------- case 31: //M31 take time since the start of the SD print or an M109 command { stoptime=_millis(); @@ -5223,7 +5406,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) autotempShutdown(); } break; - case 42: //M42 -Change pin status via gcode + + //! ### M42 - Set pin state + // ----------------------------- + case 42: if (code_seen('S')) { int pin_status = code_value(); @@ -5250,7 +5436,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } } break; - case 44: //! M44: Prusa3D: Reset the bed skew and offset calibration. + + + //! ### M44 - Reset the bed skew and offset calibration (Prusa specific) + // -------------------------------------------------------------------- + case 44: // M44: Prusa3D: Reset the bed skew and offset calibration. // Reset the baby step value and the baby step applied flag. calibration_status_store(CALIBRATION_STATUS_ASSEMBLED); @@ -5264,7 +5454,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) world2machine_revert_to_uncorrected(); break; - case 45: //! M45: Prusa3D: bed skew and offset with manual Z up + //! ### M45 - Bed skew and offset with manual Z up (Prusa specific) + // ------------------------------------------------------ + case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); @@ -5303,15 +5495,17 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) } */ + //! ### M47 - Show end stops dialog on the display (Prusa specific) + // ---------------------------------------------------- case 47: - //! M47: Prusa3D: Show end stops dialog on the display. + KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_diag_show_end_stops(); KEEPALIVE_STATE(IN_HANDLER); break; #if 0 - case 48: //! M48: scan the bed induction sensor points, print the sensor trigger coordinates to the serial line for visualization on the PC. + case 48: // M48: scan the bed induction sensor points, print the sensor trigger coordinates to the serial line for visualization on the PC. { // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); @@ -5349,11 +5543,15 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) #ifdef ENABLE_AUTO_BED_LEVELING #ifdef Z_PROBE_REPEATABILITY_TEST - //! M48 Z-Probe repeatability measurement function. + + //! ### M48 - Z-Probe repeatability measurement function. + // ------------------------------------------------------ //! - //! Usage: M48 - //! - //! This function assumes the bed has been homed. Specificaly, that a G28 command + //! _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. @@ -5599,6 +5797,13 @@ Sigma_Exit: } #endif // Z_PROBE_REPEATABILITY_TEST #endif // ENABLE_AUTO_BED_LEVELING + + //! ### M73 - Set/get print progress + // ------------------------------------- + //! _Usage:_ + //! + //! M73 P R Q S + //! 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(); @@ -5612,6 +5817,8 @@ Sigma_Exit: } break; + //! ### M104 - Set hotend temperature + // ----------------------------------------- case 104: // M104 { uint8_t extruder; @@ -5625,13 +5832,22 @@ Sigma_Exit: setWatch(); break; } - case 112: // M112 -Emergency Stop + + //! ### M112 - Emergency stop + // ----------------------------------------- + case 112: kill(_n(""), 3); break; - case 140: // M140 set bed temp + + //! ### M140 - Set bed temperature + // ----------------------------------------- + case 140: if (code_seen('S')) setTargetBed(code_value()); break; - case 105 : // M105 + + //! ### M105 - Report temperatures + // ----------------------------------------- + case 105: { uint8_t extruder; if(setTargetedHotend(105, extruder)){ @@ -5725,8 +5941,11 @@ Sigma_Exit: return; break; } + + //! ### M109 - Wait for extruder temperature + // ------------------------------------------------- case 109: - {// M109 - Wait for extruder heater to reach target. + { uint8_t extruder; if(setTargetedHotend(109, extruder)){ break; @@ -5776,7 +5995,10 @@ Sigma_Exit: previous_millis_cmd = _millis(); } break; - case 190: // M190 - Wait for bed heater to reach target. + + //! ### M190 - Wait for bed temperature + // --------------------------------------- + case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); heating_status = 3; @@ -5827,7 +6049,10 @@ Sigma_Exit: break; #if defined(FAN_PIN) && FAN_PIN > -1 - case 106: //!M106 Sxxx Fan On S 0 .. 255 + + //! ### M106 - Set fan speed + // ------------------------------------------- + case 106: // M106 Sxxx Fan On S 0 .. 255 if (code_seen('S')){ fanSpeed=constrain(code_value(),0,255); } @@ -5835,13 +6060,19 @@ Sigma_Exit: fanSpeed=255; } break; - case 107: //M107 Fan Off + + //! ### M107 - Fan off + // ------------------------------- + case 107: fanSpeed = 0; break; #endif //FAN_PIN #if defined(PS_ON_PIN) && PS_ON_PIN > -1 - case 80: // M80 - Turn on Power Supply + + //! ### M80 - Turn on the Power Supply + // ------------------------------- + case 80: SET_OUTPUT(PS_ON_PIN); //GND WRITE(PS_ON_PIN, PS_ON_AWAKE); @@ -5859,7 +6090,9 @@ Sigma_Exit: break; #endif - case 81: // M81 - Turn off Power Supply + //! ### M81 - Turn off Power Supply + // -------------------------------------- + case 81: disable_heater(); st_synchronize(); disable_e0(); @@ -5880,12 +6113,24 @@ Sigma_Exit: lcd_update(0); break; + //! ### M82 - Set E axis to absolute mode + // --------------------------------------- case 82: axis_relative_modes[3] = false; break; + + //! ### M83 - Set E axis to relative mode + // --------------------------------------- case 83: axis_relative_modes[3] = 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] + //! case 18: //compatibility case 84: // M84 if(code_seen('S')){ @@ -5921,21 +6166,35 @@ Sigma_Exit: print_time_remaining_init(); snmm_filaments_used = 0; break; + + //! ### M85 - Set max inactive time + // --------------------------------------- case 85: // M85 if(code_seen('S')) { max_inactive_time = code_value() * 1000; } break; #ifdef SAFETYTIMER - case 86: // M86 - set 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 + //! + //! _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. + case 86: if (code_seen('S')) { safetytimer_inactive_time = code_value() * 1000; safetyTimer.start(); } break; #endif - case 92: // M92 + + //! ### M92 Set Axis steps-per-unit + // --------------------------------------- + //! Same syntax as G92 + case 92: for(int8_t i=0; i < NUM_AXIS; i++) { if(code_seen(axis_codes[i])) @@ -5956,11 +6215,17 @@ Sigma_Exit: } } break; - case 110: //! M110 N - reset line pos + + //! ### M110 - Set Line number + // --------------------------------------- + case 110: if (code_seen('N')) gcode_LastN = code_value_long(); break; - case 113: // M113 - Get or set Host Keepalive interval + + //! ### M113 - Get or set host keep-alive interval + // ------------------------------------------ + case 113: if (code_seen('S')) { host_keepalive_interval = (uint8_t)code_value_short(); // NOMORE(host_keepalive_interval, 60); @@ -5971,6 +6236,16 @@ Sigma_Exit: SERIAL_PROTOCOLLN(""); } 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 if (code_seen('V')) { // Report the Prusa version number. @@ -5992,22 +6267,43 @@ Sigma_Exit: SERIAL_ECHOLNPGM(MACHINE_UUID); } break; -/* case 117: // M117 display message + + //! ### M114 - Get current position + // ------------------------------------- + case 114: + gcode_M114(); + break; + + + + //! ### M117 - Set LCD Message + // -------------------------------------- + + /* + M117 moved up to get the high priority + + case 117: // M117 display message starpos = (strchr(strchr_pointer + 5,'*')); if(starpos!=NULL) *(starpos)='\0'; lcd_setstatus(strchr_pointer + 5); break;*/ - case 114: // M114 - gcode_M114(); - break; - case 120: //! M120 - Disable endstops + + //! ### M120 - Disable endstops + // ---------------------------------------- + case 120: enable_endstops(false) ; break; - case 121: //! M121 - Enable endstops + + //! ### M121 - Enable endstops + // ---------------------------------------- + case 121: enable_endstops(true) ; break; - case 119: // M119 + + //! ### M119 - Get endstop states + // ---------------------------------------- + case 119: SERIAL_PROTOCOLRPGM(_N("Reporting endstop status"));////MSG_M119_REPORT SERIAL_PROTOCOLLN(""); #if defined(X_MIN_PIN) && X_MIN_PIN > -1 @@ -6066,8 +6362,12 @@ Sigma_Exit: #endif break; //TODO: update for all axis, use for loop + #ifdef BLINKM - case 150: // M150 + + //! ### M150 - Set RGB(W) Color + // ------------------------------------------- + case 150: { byte red; byte grn; @@ -6081,6 +6381,9 @@ Sigma_Exit: } break; #endif //BLINKM + + //! ### M200 - Set filament diameter + // ---------------------------------------- case 200: // M200 D set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters). { @@ -6119,7 +6422,10 @@ Sigma_Exit: calculate_extruder_multipliers(); } break; - case 201: // M201 + + //! ### M201 - Set Print Max Acceleration + // ------------------------------------------- + case 201: for (int8_t i = 0; i < NUM_AXIS; i++) { if (code_seen(axis_codes[i])) @@ -6151,6 +6457,9 @@ Sigma_Exit: } break; #endif + + //! ### M203 - Set Max Feedrate + // --------------------------------------- case 203: // M203 max feedrate mm/sec for (int8_t i = 0; i < NUM_AXIS; i++) { @@ -6174,10 +6483,17 @@ 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) case 204: - //! M204 acclereration settings. - //!@n Supporting old format: M204 S[normal moves] T[filmanent only moves] - //!@n and new format: M204 P[printing moves] R[filmanent only moves] T[travel moves] (as of now T is ignored) { if(code_seen('S')) { // Legacy acceleration format. This format is used by the legacy Marlin, MK2 or MK3 firmware, @@ -6201,7 +6517,19 @@ Sigma_Exit: } } break; - case 205: //M205 advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk + + //! ### M205 - Set advanced settings + // --------------------------------------------- + //! Set some advanced settings related to movement. + //! + //! M205 [S] [T] [B] [X] [Y] [Z] [E] + /*! + - `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 + */ + case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); if(code_seen('T')) cs.mintravelfeedrate = code_value(); @@ -6214,13 +6542,19 @@ Sigma_Exit: if (cs.max_jerk[Y_AXIS] > DEFAULT_YJERK) cs.max_jerk[Y_AXIS] = DEFAULT_YJERK; } break; - case 206: // M206 additional homing offset + + //! ### M206 - Set additional homing offsets + // ---------------------------------------------- + case 206: for(int8_t i=0; i < 3; i++) { if(code_seen(axis_codes[i])) cs.add_homing[i] = code_value(); } break; #ifdef FWRETRACT + + //! ### M207 - Set firmware retraction + // -------------------------------------------------- case 207: //M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop] { if(code_seen('S')) @@ -6236,6 +6570,9 @@ Sigma_Exit: cs.retract_zlift = code_value() ; } }break; + + //! ### M208 - Set retract recover length + // -------------------------------------------- case 208: // M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/min] { if(code_seen('S')) @@ -6247,6 +6584,9 @@ Sigma_Exit: cs.retract_recover_feedrate = code_value()/60 ; } }break; + + //! ### M209 - Enable/disable automatict retract + // --------------------------------------------- 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')) @@ -6287,6 +6627,9 @@ Sigma_Exit: }break; #endif // FWRETRACT #if EXTRUDERS > 1 + + // ### M218 - Set hotend offset + // ---------------------------------------- case 218: // M218 - set hotend offset (in mm), T X Y { uint8_t extruder; @@ -6314,6 +6657,8 @@ Sigma_Exit: }break; #endif + //! ### M220 Set feedrate percentage + // ----------------------------------------------- case 220: // M220 S- set speed factor override percentage { if (code_seen('B')) //backup current speed factor @@ -6329,6 +6674,9 @@ Sigma_Exit: } } break; + + //! ### M221 - Set extrude factor override percentage + // ---------------------------------------------------- case 221: // M221 S- set extrude factor override percentage { if(code_seen('S')) @@ -6351,6 +6699,8 @@ Sigma_Exit: } break; + //! ### M226 - Wait for Pin state + // ------------------------------------------ case 226: // M226 P S- Wait until the specified pin reaches the state required { if(code_seen('P')){ @@ -6404,6 +6754,9 @@ Sigma_Exit: break; #if NUM_SERVOS > 0 + + //! ### M280 - Set/Get servo position + // -------------------------------------------- case 280: // M280 - set servo position absolute. P: servo index, S: angle or microseconds { int servo_index = -1; @@ -6442,6 +6795,9 @@ Sigma_Exit: #endif // NUM_SERVOS > 0 #if (LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) || defined(LCD_USE_I2C_BUZZER))) + + //! ### M300 - Play tone + // ----------------------- case 300: // M300 { int beepS = code_seen('S') ? code_value() : 110; @@ -6461,7 +6817,10 @@ Sigma_Exit: #endif // M300 #ifdef PIDTEMP - case 301: // M301 + + //! ### M301 - Set hotend PID + // --------------------------------------- + case 301: { if(code_seen('P')) cs.Kp = code_value(); if(code_seen('I')) cs.Ki = scalePID_i(code_value()); @@ -6489,7 +6848,10 @@ Sigma_Exit: break; #endif //PIDTEMP #ifdef PIDTEMPBED - case 304: // M304 + + //! ### M304 - Set bed PID + // -------------------------------------- + case 304: { if(code_seen('P')) cs.bedKp = code_value(); if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); @@ -6507,6 +6869,9 @@ Sigma_Exit: } break; #endif //PIDTEMP + + //! ### M240 - Trigger camera + // -------------------------------------------- case 240: // M240 Triggers a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/ { #ifdef CHDK @@ -6539,7 +6904,10 @@ Sigma_Exit: } break; #ifdef PREVENT_DANGEROUS_EXTRUDE - case 302: // allow cold extrudes, or set the minimum extrude temperature + + //! ### M302 - Allow cold extrude, or set minimum extrude temperature + // ------------------------------------------------------------------- + case 302: { float temp = .0; if (code_seen('S')) temp=code_value(); @@ -6547,7 +6915,10 @@ Sigma_Exit: } break; #endif - case 303: // M303 PID autotune + + //! ### M303 - PID autotune + // ------------------------------------- + case 303: { float temp = 150.0; int e=0; @@ -6560,17 +6931,22 @@ Sigma_Exit: PID_autotune(temp, e, c); } break; - case 400: // M400 finish all moves + + //! ### M400 - Wait for all moves to finish + // ----------------------------------------- + case 400: { st_synchronize(); } break; - case 403: //! M403 set filament type (material) for particular extruder and send this information to mmu + //! ### M403 - Set filament type (material) for particular extruder and notify the MMU + // ---------------------------------------------- + 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 - //!firmware does not wait for "ok" from mmu + // currently three different materials are needed (default, flex and PVA) + // add storing this information for different load/unload profiles etc. in the future + // firmware does not wait for "ok" from mmu if (mmu_enabled) { uint8_t extruder = 255; @@ -6582,27 +6958,41 @@ Sigma_Exit: } break; - case 500: // M500 Store settings in EEPROM + //! ### M500 - Store settings in EEPROM + // ----------------------------------------- + case 500: { Config_StoreSettings(); } break; - case 501: // M501 Read settings from EEPROM + + //! ### M501 - Read settings from EEPROM + // ---------------------------------------- + case 501: { Config_RetrieveSettings(); } break; - case 502: // M502 Revert to default settings + + //! ### M502 - Revert all settings to factory default + // ------------------------------------------------- + case 502: { Config_ResetDefault(); } break; - case 503: // M503 print settings currently in memory + + //! ### M503 - Repport all settings currently in memory + // ------------------------------------------------- + case 503: { Config_PrintSettings(); } break; - case 509: //M509 Force language selection + + //! ### M509 - Force language selection + // ------------------------------------------------ + case 509: { lang_reset(); SERIAL_ECHO_START; @@ -6610,6 +7000,9 @@ Sigma_Exit: } break; #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + + //! ### M540 - Abort print on endstop hit (enable/disable) + // ----------------------------------------------------- case 540: { if(code_seen('S')) abort_on_endstop_hit = code_value() > 0; @@ -6654,6 +7047,9 @@ Sigma_Exit: #endif // CUSTOM_M_CODE_SET_Z_PROBE_OFFSET #ifdef FILAMENTCHANGEENABLE + + //! ### M600 - Initiate Filament change procedure + // -------------------------------------- case 600: //Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal] { st_synchronize(); @@ -6728,24 +7124,39 @@ Sigma_Exit: } break; #endif //FILAMENTCHANGEENABLE - case 601: //! M601 - Pause print + + //! ### M601 - Pause print + // ------------------------------- + case 601: { cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore lcd_pause_print(); } break; - case 602: { //! M602 - Resume print + //! ### M602 - Resume print + // ------------------------------- + case 602: { lcd_resume_print(); } break; - case 603: { //! M603 - Stop print + //! ### M603 - Stop print + // ------------------------------- + case 603: { lcd_print_stop(); } #ifdef PINDA_THERMISTOR - case 860: // M860 - Wait for PINDA thermistor to reach target temperature. + //! ### M860 - Wait for extruder temperature (PINDA) + // -------------------------------------------------------------- + /*! + Wait for PINDA thermistor to reach target temperature + + M860 [S] + + */ + case 860: { int set_target_pinda = 0; @@ -6789,7 +7200,18 @@ Sigma_Exit: break; } - case 861: // M861 - Set/Read PINDA temperature compensation offsets + //! ### 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 + */ + case 861: if (code_seen('?')) { // ? - Print out current EEPROM offset values uint8_t cal_status = calibration_status_pinda(); int16_t usteps = 0; @@ -6860,7 +7282,27 @@ Sigma_Exit: break; #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. + + */ case 862: // M862: print checking float nDummy; uint8_t nCommand; @@ -6921,12 +7363,16 @@ Sigma_Exit: break; #ifdef LIN_ADVANCE - case 900: // M900: Set LIN_ADVANCE options. + //! ### M900 - Set Linear advance options + // ---------------------------------------------- + case 900: gcode_M900(); break; #endif - case 907: // M907 Set digital trimpot motor current using axis codes. + //! ### M907 - Set digital trimpot motor current using axis codes + // --------------------------------------------------------------- + case 907: { #ifdef TMC2130 for (int i = 0; i < NUM_AXIS; i++) @@ -6957,7 +7403,10 @@ Sigma_Exit: #endif //TMC2130 } break; - case 908: // M908 Control digital trimpot directly. + + //! ### M908 - Control digital trimpot directly + // --------------------------------------------------------- + case 908: { #if defined(DIGIPOTSS_PIN) && DIGIPOTSS_PIN > -1 uint8_t channel,current; @@ -6970,13 +7419,17 @@ Sigma_Exit: #ifdef TMC2130_SERVICE_CODES_M910_M918 - case 910: //! M910 - TMC2130 init + //! ### M910 - TMC2130 init + // ----------------------------------------------- + case 910: { tmc2130_init(); } break; - case 911: //! M911 - Set TMC2130 holding currents + //! ### M911 - Set TMC2130 holding currents + // ------------------------------------------------- + case 911: { if (code_seen('X')) tmc2130_set_current_h(0, code_value()); if (code_seen('Y')) tmc2130_set_current_h(1, code_value()); @@ -6985,7 +7438,9 @@ Sigma_Exit: } break; - case 912: //! M912 - Set TMC2130 running currents + //! ### M912 - Set TMC2130 running currents + // ----------------------------------------------- + case 912: { if (code_seen('X')) tmc2130_set_current_r(0, code_value()); if (code_seen('Y')) tmc2130_set_current_r(1, code_value()); @@ -6993,13 +7448,18 @@ Sigma_Exit: if (code_seen('E')) tmc2130_set_current_r(3, code_value()); } break; - case 913: //! M913 - Print TMC2130 currents + + //! ### M913 - Print TMC2130 currents + // ----------------------------- + case 913: { tmc2130_print_currents(); } break; - case 914: //! M914 - Set normal mode + //! ### M914 - Set TMC2130 normal mode + // ------------------------------ + case 914: { tmc2130_mode = TMC2130_MODE_NORMAL; update_mode_profile(); @@ -7007,7 +7467,9 @@ Sigma_Exit: } break; - case 915: //! M915 - Set silent mode + //! ### M95 - Set TMC2130 silent mode + // ------------------------------ + case 915: { tmc2130_mode = TMC2130_MODE_SILENT; update_mode_profile(); @@ -7015,7 +7477,9 @@ Sigma_Exit: } break; - case 916: //! M916 - Set sg_thrs + //! ### M916 - Set TMC2130 Stallguard sensitivity threshold + // ------------------------------------------------------- + case 916: { if (code_seen('X')) tmc2130_sg_thr[X_AXIS] = code_value(); if (code_seen('Y')) tmc2130_sg_thr[Y_AXIS] = code_value(); @@ -7026,7 +7490,9 @@ Sigma_Exit: } break; - case 917: //! M917 - Set TMC2130 pwm_ampl + //! ### M917 - Set TMC2130 PWM amplitude offset (pwm_ampl) + // -------------------------------------------------------------- + case 917: { if (code_seen('X')) tmc2130_set_pwm_ampl(0, code_value()); if (code_seen('Y')) tmc2130_set_pwm_ampl(1, code_value()); @@ -7035,7 +7501,9 @@ Sigma_Exit: } break; - case 918: //! M918 - Set TMC2130 pwm_grad + //! ### M918 - Set TMC2130 PWM amplitude gradient (pwm_grad) + // ------------------------------------------------------------- + case 918: { if (code_seen('X')) tmc2130_set_pwm_grad(0, code_value()); if (code_seen('Y')) tmc2130_set_pwm_grad(1, code_value()); @@ -7046,7 +7514,10 @@ Sigma_Exit: #endif //TMC2130_SERVICE_CODES_M910_M918 - case 350: //! M350 - Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. + //! ### M350 - Set microstepping mode + // --------------------------------------------------- + //! Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. + case 350: { #ifdef TMC2130 if(code_seen('E')) @@ -7083,7 +7554,13 @@ Sigma_Exit: #endif //TMC2130 } break; - case 351: //! M351 - Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low. + + //! ### 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>] + case 351: { #if defined(X_MS1_PIN) && X_MS1_PIN > -1 if(code_seen('S')) switch((int)code_value()) @@ -7101,14 +7578,28 @@ Sigma_Exit: #endif } break; - case 701: //! M701 - load filament + + //! ### M701 - Load filament + // ------------------------- + case 701: { if (mmu_enabled && code_seen('E')) tmp_extruder = code_value(); gcode_M701(); } break; - case 702: //! M702 [U C] - + + //! ### 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 + */ + case 702: { #ifdef SNMM if (code_seen('U')) @@ -7130,7 +7621,9 @@ Sigma_Exit: } break; - case 999: // M999: Restart after being stopped + //! ### M999 - Restart after being stopped + // ------------------------------------ + case 999: Stopped = false; lcd_reset_alert_level(); gcode_LastN = Stopped_gcode_LastN; @@ -7144,6 +7637,10 @@ 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 @@ -7337,46 +7834,95 @@ Sigma_Exit: } } // end if(code_seen('T')) (end of T codes) + //! ---------------------------------------------------------------------------------------------- + else if (code_seen('D')) // D codes (debug) { switch((int)code_value()) { - case -1: //! D-1 - Endless loop + + //! ### D-1 - Endless loop + // ------------------- + case -1: dcode__1(); break; #ifdef DEBUG_DCODES - case 0: //! D0 - Reset + + //! ### D0 - Reset + // -------------- + case 0: dcode_0(); break; - case 1: //! D1 - Clear EEPROM + + //! ### D1 - Clear EEPROM + // ------------------ + case 1: dcode_1(); break; - case 2: //! D2 - Read/Write RAM + + //! ### D2 - Read/Write RAM + // -------------------- + case 2: dcode_2(); break; #endif //DEBUG_DCODES #ifdef DEBUG_DCODE3 - case 3: //! D3 - Read/Write EEPROM + + //! ### D3 - Read/Write EEPROM + // ----------------------- + case 3: dcode_3(); break; #endif //DEBUG_DCODE3 #ifdef DEBUG_DCODES - case 4: //! D4 - Read/Write PIN + + //! ### D4 - Read/Write PIN + // --------------------- + case 4: dcode_4(); break; #endif //DEBUG_DCODES #ifdef DEBUG_DCODE5 - case 5: // D5 - Read/Write FLASH + + //! ### D5 - Read/Write FLASH + // ------------------------ + case 5: dcode_5(); break; break; #endif //DEBUG_DCODE5 #ifdef DEBUG_DCODES - case 6: // D6 - Read/Write external FLASH + + //! ### D6 - Read/Write external FLASH + // --------------------------------------- + case 6: dcode_6(); break; - case 7: //! D7 - Read/Write Bootloader + + //! ### D7 - Read/Write Bootloader + // ------------------------------- + case 7: dcode_7(); break; - case 8: //! D8 - Read/Write PINDA + + //! ### D8 - Read/Write PINDA + // --------------------------- + case 8: dcode_8(); break; - case 9: //! D9 - Read/Write ADC + + // ### D9 - Read/Write ADC + // ------------------------ + case 9: dcode_9(); break; - case 10: //! D10 - XYZ calibration = OK + + //! ### D10 - XYZ calibration = OK + // ------------------------------ + case 10: dcode_10(); break; #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 + */ case 80: { float dimension_x = 40; @@ -7401,6 +7947,16 @@ 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 + */ case 81: { float dimension_x = 40; @@ -7423,7 +7979,10 @@ Sigma_Exit: #endif //HEATBED_ANALYSIS #ifdef DEBUG_DCODES - case 106: //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) { fanSpeed = i; @@ -7437,12 +7996,52 @@ Sigma_Exit: }break; #ifdef TMC2130 - case 2130: //! D2130 - 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 + */ + + + case 2130: dcode_2130(); break; #endif //TMC2130 #if (defined (FILAMENT_SENSOR) && defined(PAT9125)) - case 9125: //! D9125 - FILAMENT_SENSOR + + //! ### D9125 - FILAMENT_SENSOR + // --------------------------------- + case 9125: dcode_9125(); break; #endif //FILAMENT_SENSOR @@ -7461,6 +8060,13 @@ Sigma_Exit: ClearToSend(); } + + + /** @defgroup GCodes G-Code List + */ + +// --------------------------------------------------- + void FlushSerialRequestResend() { //char cmdbuffer[bufindr][100]="Resend:"; diff --git a/Firmware/doxyfile b/Firmware/doxyfile index 9c2d550c..346ce604 100644 --- a/Firmware/doxyfile +++ b/Firmware/doxyfile @@ -2050,7 +2050,7 @@ PERLMOD_MAKEVAR_PREFIX = # C-preprocessor directives found in the sources and include files. # The default value is: YES. -ENABLE_PREPROCESSING = YES +ENABLE_PREPROCESSING = NO # If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names # in the source code. If set to NO, only conditional compilation will be diff --git a/Firmware/eeprom.cpp b/Firmware/eeprom.cpp index 1be708d0..f2d89716 100644 --- a/Firmware/eeprom.cpp +++ b/Firmware/eeprom.cpp @@ -71,6 +71,12 @@ void eeprom_init() } if(is_uninitialized) { + // When upgrading from version older version (before multiple sheets were implemented in v3.8.0) + // Sheet 1 uses the previous Live adjust Z (@EEPROM_BABYSTEP_Z) + if(i == 0){ + int last_babystep = eeprom_read_word((uint16_t *)EEPROM_BABYSTEP_Z); + eeprom_write_word(reinterpret_cast(&(EEPROM_Sheets_base->s[i].z_offset)), last_babystep); + } eeprom_write(&(EEPROM_Sheets_base->s[i].name[0]), static_cast(i + '1')); eeprom_write(&(EEPROM_Sheets_base->s[i].name[1]), '\0'); }