Browse Source

Change filament number in T command to alternative if depleted and lcd_autoDepleteEnabled().

Marek Bel 5 years ago
parent
commit
c080b899c3
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Firmware/Marlin_main.cpp

+ 5 - 0
Firmware/Marlin_main.cpp

@@ -78,6 +78,7 @@
 #include <avr/pgmspace.h>
 
 #include "Dcodes.h"
+#include "AutoDeplete.h"
 
 
 #ifdef SWSPI
@@ -6920,6 +6921,10 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
           }
           else {
               tmp_extruder = code_value();
+              if (mmu_enabled && lcd_autoDepleteEnabled())
+              {
+                  tmp_extruder = ad_getAlternative(tmp_extruder);
+              }
           }
           st_synchronize();
           snmm_filaments_used |= (1 << tmp_extruder); //for stop print