Browse Source

Merge pull request #1333 from PavelSindler/T_codes

T-code fix
XPila 5 years ago
parent
commit
c41b045ea7
1 changed files with 6 additions and 2 deletions
  1. 6 2
      Firmware/Marlin_main.cpp

+ 6 - 2
Firmware/Marlin_main.cpp

@@ -6852,7 +6852,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
   else if(code_seen('T'))
   {
       int index;
-      st_synchronize();
+      bool load_to_nozzle = false;
       for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++);
 
 	  *(strchr_pointer + index) = tolower(*(strchr_pointer + index));
@@ -6864,6 +6864,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
 		if (mmu_enabled)
 		{
 			tmp_extruder = choose_menu_P(_T(MSG_CHOOSE_FILAMENT), _T(MSG_FILAMENT));
+			st_synchronize();
 			mmu_command(MMU_CMD_T0 + tmp_extruder);
 			manage_response(true, true);
 		}
@@ -6871,6 +6872,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
 	  else if (*(strchr_pointer + index) == 'c') { //load to from bondtech gears to nozzle (nozzle should be preheated)
 	  	if (mmu_enabled) 
 		{
+			st_synchronize();
 			mmu_command(MMU_CMD_C0);
 			mmu_extruder = tmp_extruder; //filament change is finished
 			mmu_load_to_nozzle();
@@ -6882,6 +6884,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
               if(mmu_enabled)
               {
                   tmp_extruder = choose_menu_P(_T(MSG_CHOOSE_FILAMENT), _T(MSG_FILAMENT));
+                  load_to_nozzle = true;
               } else
               {
                   tmp_extruder = choose_menu_P(_T(MSG_CHOOSE_EXTRUDER), _T(MSG_EXTRUDER));
@@ -6890,6 +6893,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
           else {
               tmp_extruder = code_value();
           }
+          st_synchronize();
           snmm_filaments_used |= (1 << tmp_extruder); //for stop print
 
           if (mmu_enabled)
@@ -6900,7 +6904,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
               mmu_command(MMU_CMD_C0);
               mmu_extruder = tmp_extruder; //filament change is finished
 
-              if (*(strchr_pointer + index) == '?')// for single material usage with mmu
+              if (load_to_nozzle)// for single material usage with mmu
               {
                   mmu_load_to_nozzle();
               }