Optimize target_extruder, ignore T with mixing (#12432)
* Optimize target_extruder, ignore T with mixing * Give G-code Tn parity with tool_change
This commit is contained in:
		@@ -39,10 +39,15 @@
 | 
			
		||||
 * M104: Set hot end temperature
 | 
			
		||||
 */
 | 
			
		||||
void GcodeSuite::M104() {
 | 
			
		||||
  if (get_target_extruder_from_command()) return;
 | 
			
		||||
 | 
			
		||||
  if (DEBUGGING(DRYRUN)) return;
 | 
			
		||||
 | 
			
		||||
  const uint8_t e = target_extruder;
 | 
			
		||||
  #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1
 | 
			
		||||
    constexpr int8_t e = 0;
 | 
			
		||||
  #else
 | 
			
		||||
    const int8_t e = get_target_extruder_from_command();
 | 
			
		||||
    if (e < 0) return;
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  if (parser.seenval('S')) {
 | 
			
		||||
    const int16_t temp = parser.value_celsius();
 | 
			
		||||
@@ -82,9 +87,15 @@ void GcodeSuite::M104() {
 | 
			
		||||
 */
 | 
			
		||||
void GcodeSuite::M109() {
 | 
			
		||||
 | 
			
		||||
  if (get_target_extruder_from_command()) return;
 | 
			
		||||
  if (DEBUGGING(DRYRUN)) return;
 | 
			
		||||
 | 
			
		||||
  #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1
 | 
			
		||||
    constexpr int8_t target_extruder = 0;
 | 
			
		||||
  #else
 | 
			
		||||
    const int8_t target_extruder = get_target_extruder_from_command();
 | 
			
		||||
    if (target_extruder < 0) return;
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  const bool no_wait_for_cooling = parser.seenval('S'),
 | 
			
		||||
             set_temp = no_wait_for_cooling || parser.seenval('R');
 | 
			
		||||
  if (set_temp) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user