From f161d3ade484cb29ea475c59627c9dd228905c28 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Mon, 4 Mar 2019 22:17:43 +0100 Subject: [PATCH] Change formatting. --- Firmware/Marlin_main.cpp | 60 +++++++++++++++++++++------------------- Firmware/mmu.cpp | 58 +++++++++++++++++++------------------- 2 files changed, 61 insertions(+), 57 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 899ec8338..4442c47ab 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -9090,39 +9090,41 @@ void load_filament_final_feed() plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_EFEED_FINAL, active_extruder); } +//! @brief Wait for user to check the state //! @par nozzle_temp nozzle temperature to load filament void M600_check_state(float nozzle_temp) { - //Wait for user to check the state - lcd_change_fil_state = 0; - while (lcd_change_fil_state != 1){ - lcd_change_fil_state = 0; - KEEPALIVE_STATE(PAUSED_FOR_USER); - lcd_alright(); - KEEPALIVE_STATE(IN_HANDLER); - switch(lcd_change_fil_state){ - // Filament failed to load so load it again - case 2: - if (mmu_enabled) - mmu_M600_load_filament(false, nozzle_temp); //nonautomatic load; change to "wrong filament loaded" option? - else - M600_load_filament_movements(); - break; + lcd_change_fil_state = 0; + while (lcd_change_fil_state != 1) + { + lcd_change_fil_state = 0; + KEEPALIVE_STATE(PAUSED_FOR_USER); + lcd_alright(); + KEEPALIVE_STATE(IN_HANDLER); + switch(lcd_change_fil_state) + { + // Filament failed to load so load it again + case 2: + if (mmu_enabled) + mmu_M600_load_filament(false, nozzle_temp); //nonautomatic load; change to "wrong filament loaded" option? + else + M600_load_filament_movements(); + break; - // Filament loaded properly but color is not clear - case 3: - st_synchronize(); - load_filament_final_feed(); - lcd_loading_color(); - st_synchronize(); - break; - - // Everything good - default: - lcd_change_success(); - break; - } - } + // Filament loaded properly but color is not clear + case 3: + st_synchronize(); + load_filament_final_feed(); + lcd_loading_color(); + st_synchronize(); + break; + + // Everything good + default: + lcd_change_success(); + break; + } + } } //! @brief Wait for user action diff --git a/Firmware/mmu.cpp b/Firmware/mmu.cpp index 0f92128be..45a3c421d 100644 --- a/Firmware/mmu.cpp +++ b/Firmware/mmu.cpp @@ -834,37 +834,39 @@ void mmu_M600_wait_and_beep() { //! @par nozzle_temp nozzle temperature to load filament void mmu_M600_load_filament(bool automatic, float nozzle_temp) { - tmp_extruder = mmu_extruder; - if (!automatic) { -#ifdef MMU_M600_SWITCH_EXTRUDER - bool yes = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Do you want to switch extruder?"), false); - if(yes) tmp_extruder = choose_extruder_menu(); -#endif //MMU_M600_SWITCH_EXTRUDER - } - else { - tmp_extruder = ad_getAlternative(tmp_extruder); - } - lcd_update_enable(false); - lcd_clear(); - lcd_set_cursor(0, 1); lcd_puts_P(_T(MSG_LOADING_FILAMENT)); - lcd_print(" "); - lcd_print(tmp_extruder + 1); - snmm_filaments_used |= (1 << tmp_extruder); //for stop print + tmp_extruder = mmu_extruder; + if (!automatic) + { + #ifdef MMU_M600_SWITCH_EXTRUDER + bool yes = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Do you want to switch extruder?"), false); + if(yes) tmp_extruder = choose_extruder_menu(); + #endif //MMU_M600_SWITCH_EXTRUDER + } + else + { + tmp_extruder = ad_getAlternative(tmp_extruder); + } + lcd_update_enable(false); + lcd_clear(); + lcd_set_cursor(0, 1); lcd_puts_P(_T(MSG_LOADING_FILAMENT)); + lcd_print(" "); + lcd_print(tmp_extruder + 1); + snmm_filaments_used |= (1 << tmp_extruder); //for stop print -// printf_P(PSTR("T code: %d \n"), tmp_extruder); -// mmu_printf_P(PSTR("T%d\n"), tmp_extruder); - setTargetHotend(nozzle_temp,active_extruder); - mmu_wait_for_heater_blocking(); + //printf_P(PSTR("T code: %d \n"), tmp_extruder); + //mmu_printf_P(PSTR("T%d\n"), tmp_extruder); + setTargetHotend(nozzle_temp,active_extruder); + mmu_wait_for_heater_blocking(); - mmu_command(MmuCmd::T0 + tmp_extruder); + mmu_command(MmuCmd::T0 + tmp_extruder); - manage_response(false, true, MMU_LOAD_MOVE); - mmu_continue_loading(); - mmu_extruder = tmp_extruder; //filament change is finished - - mmu_load_to_nozzle(); - load_filament_final_feed(); - st_synchronize(); + manage_response(false, true, MMU_LOAD_MOVE); + mmu_continue_loading(); + mmu_extruder = tmp_extruder; //filament change is finished + + mmu_load_to_nozzle(); + load_filament_final_feed(); + st_synchronize(); }