Cut filament when cutter is enabled and MMU load fails.

This commit is contained in:
Marek Bel 2019-02-27 10:42:26 +01:00
parent 49b1d1cb93
commit 4a4eb9962c
4 changed files with 18 additions and 0 deletions

View File

@ -285,6 +285,7 @@ void setPwmFrequency(uint8_t pin, int val);
#endif //CRITICAL_SECTION_START
extern bool fans_check_enabled;
extern bool cutter_enabled;
extern float homing_feedrate[];
extern bool axis_relative_modes[];
extern int feedmultiply;

View File

@ -510,6 +510,7 @@ void servo_init()
bool fans_check_enabled = true;
bool cutter_enabled = false;
#ifdef TMC2130

View File

@ -1439,6 +1439,12 @@ void mmu_continue_loading()
if(mmu_load_fail < 255) eeprom_update_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, mmu_load_fail + 1);
if(mmu_load_fail_tot < 65535) eeprom_update_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, mmu_load_fail_tot + 1);
if (cutter_enabled)
{
mmu_command(MmuCmd::K0 + tmp_extruder);
manage_response(true, true, MMU_UNLOAD_MOVE);
}
mmu_command(MmuCmd::T0 + tmp_extruder);
manage_response(true, true, MMU_TCODE_MOVE);
load_more();

View File

@ -199,6 +199,7 @@ static void fil_unload_menu();
#endif // SNMM || SNMM_V2
static void lcd_disable_farm_mode();
static void lcd_set_fan_check();
static void lcd_cutter_enabled();
static char snmm_stop_print_menu();
#ifdef SDCARD_SORT_ALPHA
static void lcd_sort_type_set();
@ -2292,6 +2293,10 @@ void lcd_set_fan_check() {
eeprom_update_byte((unsigned char *)EEPROM_FAN_CHECK_ENABLED, fans_check_enabled);
}
void lcd_cutter_enabled() {
cutter_enabled = !cutter_enabled;
}
void lcd_set_filament_autoload() {
fsensor_autoload_set(!fsensor_autoload_enabled);
}
@ -5207,6 +5212,11 @@ static void lcd_settings_menu()
SETTINGS_AUTO_DEPLETE;
if (cutter_enabled == true)
MENU_ITEM_FUNCTION_P(_i("Cutter [on]"), lcd_cutter_enabled);////MSG_FANS_CHECK_ON c=17 r=1
else
MENU_ITEM_FUNCTION_P(_i("Cutter [off]"), lcd_cutter_enabled);////MSG_FANS_CHECK_OFF c=17 r=1
if (fans_check_enabled == true)
MENU_ITEM_FUNCTION_P(_i("Fans check [on]"), lcd_set_fan_check);////MSG_FANS_CHECK_ON c=17 r=1
else