Browse Source

Reduce setTargetedHotend by removing the switch

pull/1/head
Scott Lahteine 10 years ago
parent
commit
be5236e839
  1. 24
      Marlin/Marlin_main.cpp

24
Marlin/Marlin_main.cpp

@ -6518,25 +6518,21 @@ void Stop() {
} }
} }
/**
* Set target_extruder from the T parameter or the active_extruder
*
* Returns TRUE if the target is invalid
*/
bool setTargetedHotend(int code) { bool setTargetedHotend(int code) {
target_extruder = active_extruder; target_extruder = active_extruder;
if (code_seen('T')) { if (code_seen('T')) {
target_extruder = code_value_short(); target_extruder = code_value_short();
if (target_extruder >= EXTRUDERS) { if (target_extruder >= EXTRUDERS) {
switch(code) { SERIAL_ECHO_START;
case 104: SERIAL_CHAR('M');
case 105: SERIAL_ECHO(code);
case 109: SERIAL_ECHOPGM(" " MSG_INVALID_EXTRUDER " ");
case 218: SERIAL_ECHOLN(target_extruder);
case 221:
case 200:
SERIAL_ECHO_START;
SERIAL_CHAR('M');
SERIAL_ECHO(code);
SERIAL_ECHOPGM(" " MSG_INVALID_EXTRUDER " ");
SERIAL_ECHOLN(target_extruder);
break;
}
return true; return true;
} }
} }

Loading…
Cancel
Save