⚡️ Slimmer null T command (#26615)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
parent
6e67ad51b7
commit
994aa9f692
10 changed files with 38 additions and 15 deletions
|
|
@ -122,14 +122,16 @@ void GcodeSuite::say_units() {
|
|||
* Return -1 if the T parameter is out of range
|
||||
*/
|
||||
int8_t GcodeSuite::get_target_extruder_from_command() {
|
||||
if (parser.seenval('T')) {
|
||||
const int8_t e = parser.value_byte();
|
||||
if (e < EXTRUDERS) return e;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum);
|
||||
SERIAL_ECHOLNPGM(" " STR_INVALID_EXTRUDER " ", e);
|
||||
return -1;
|
||||
}
|
||||
#if HAS_TOOLCHANGE
|
||||
if (parser.seenval('T')) {
|
||||
const int8_t e = parser.value_byte();
|
||||
if (e < EXTRUDERS) return e;
|
||||
SERIAL_ECHO_START();
|
||||
SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum);
|
||||
SERIAL_ECHOLNPGM(" " STR_INVALID_EXTRUDER " ", e);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
return active_extruder;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue