Skip to content

Commit

Permalink
simplify more
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Aug 7, 2023
1 parent 86c66a6 commit 9eb4147
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Marlin/src/gcode/control/T.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@
* S1 Don't move the tool in XY after change
*
* For PRUSA_MMU2(S) and EXTENDABLE_EMU_MMU2(S)
* T[n] Gcode to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels.
* T? Gcode to extrude shouldn't have to follow. Load to extruder wheels is done automatically.
* T[n] G-code to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels.
* T? G-code to extrude shouldn't have to follow. Load to extruder wheels is done automatically.
* Tx Same as T?, but nozzle doesn't have to be preheated. Tc requires a preheated nozzle to finish filament load.
* Tc Load to nozzle after filament was prepared by Tc and nozzle is already heated.
*/
void GcodeSuite::T(const int8_t tool_index) {

#if HAS_MULTI_EXTRUDER
// For 'T' with no parameter report the current tool.
if (tool_index == 255) {
if (parser.string_arg && *parser.string_arg == '*') {
SERIAL_ECHOLNPGM(STR_ACTIVE_EXTRUDER, active_extruder);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ void GCodeParser::parse(char *p) {
// Bail if there's no command code number
if (!TERN(SIGNED_CODENUM, NUMERIC_SIGNED(*p), NUMERIC(*p))) {
if (TERN0(HAS_MULTI_EXTRUDER, letter == 'T')) {
p[0] = '2'; p[1] = '5'; p[2] = '5'; p[3] = '\0'; // Convert 'T' alone into T255
*p = '*'; string_arg = p; // Convert 'T' alone into 'T*'
}
else return;
return;
}

// Save the command letter at this point
Expand Down

0 comments on commit 9eb4147

Please sign in to comment.