Selaa lähdekoodia

Merge pull request #1073 from PavelSindler/M600_mmu_fix

M600 mmu fix
PavelSindler 6 vuotta sitten
vanhempi
commit
b01e2a1a22
3 muutettua tiedostoa jossa 12 lisäystä ja 7 poistoa
  1. 3 4
      Firmware/Marlin_main.cpp
  2. 8 3
      Firmware/mmu.cpp
  3. 1 0
      Firmware/mmu.h

+ 3 - 4
Firmware/Marlin_main.cpp

@@ -8846,8 +8846,7 @@ void M600_check_state()
 {
 		//Wait for user to check the state
 		lcd_change_fil_state = 0;
-		
-		while ((lcd_change_fil_state == 0)||(lcd_change_fil_state != 1)){
+		while (lcd_change_fil_state != 1){
 			lcd_change_fil_state = 0;
 			KEEPALIVE_STATE(PAUSED_FOR_USER);
 			lcd_alright();
@@ -8874,7 +8873,7 @@ void M600_check_state()
 					lcd_update_enable(true);
 					break;
 			}
-	}
+		}
 }
 
 void M600_wait_for_user() {
@@ -9039,7 +9038,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
 			fsensor_disable();
 	}
 #endif //FILAMENT_SENSOR
-
+	lcd_update_enable(false);
 }
 
 #define FIL_LOAD_LENGTH 60

+ 8 - 3
Firmware/mmu.cpp

@@ -178,7 +178,13 @@ void mmu_loop(void)
 			else if (mmu_cmd == MMU_CMD_C0)
 			{
 				printf_P(PSTR("MMU <= 'C0'\n"));
-				mmu_puts_P(PSTR("C0\n")); //send continue loading
+				mmu_puts_P(PSTR("C0\n")); //send 'continue loading'
+				mmu_state = 3;
+			}
+			else if (mmu_cmd == MMU_CMD_U0)
+			{
+				printf_P(PSTR("MMU <= 'U0'\n"));
+				mmu_puts_P(PSTR("U0\n")); //send 'unload current filament'
 				mmu_state = 3;
 			}
 			mmu_cmd = 0;
@@ -596,9 +602,8 @@ void extr_unload()
 		current_position[E_AXIS] -= 80;
 		plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 2500 / 60, active_extruder);
 		st_synchronize();
-		printf_P(PSTR("U0\n"));
-		fprintf_P(uart2io, PSTR("U0\n"));
 
+		mmu_command(MMU_CMD_U0);
 		// get response
 		manage_response(false, true);
 

+ 1 - 0
Firmware/mmu.h

@@ -29,6 +29,7 @@ extern int16_t mmu_buildnr;
 #define MMU_CMD_L3   0x23
 #define MMU_CMD_L4   0x24
 #define MMU_CMD_C0   0x30
+#define MMU_CMD_U0   0x40
 
 extern int mmu_puts_P(const char* str);