Skip to content

Commit

Permalink
Disable mmu filament cutter feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkbel committed Mar 15, 2019
1 parent 3b78e61 commit ffe45bd
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 17 deletions.
36 changes: 20 additions & 16 deletions Firmware/mmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1365,25 +1365,27 @@ bFilamentAction=false; // NOT in "mmu_load_to_nozzle_
}
}

#ifdef MMU_HAS_CUTTER
void mmu_cut_filament(uint8_t filament_nr)
{
bFilamentAction=false; // NOT in "mmu_load_to_nozzle_menu()"
if (degHotend0() > EXTRUDE_MINTEMP)
{
LcdUpdateDisabler disableLcdUpdate;
lcd_clear();
lcd_set_cursor(0, 1); lcd_puts_P(_i("Cutting filament")); //// c=18 r=1
lcd_print(" ");
lcd_print(filament_nr + 1);
mmu_filament_ramming();
mmu_command(MmuCmd::K0 + filament_nr);
manage_response(false, false, MMU_UNLOAD_MOVE);
}
else
{
show_preheat_nozzle_warning();
}
bFilamentAction=false; // NOT in "mmu_load_to_nozzle_menu()"
if (degHotend0() > EXTRUDE_MINTEMP)
{
LcdUpdateDisabler disableLcdUpdate;
lcd_clear();
lcd_set_cursor(0, 1); lcd_puts_P(_i("Cutting filament")); //// c=18 r=1
lcd_print(" ");
lcd_print(filament_nr + 1);
mmu_filament_ramming();
mmu_command(MmuCmd::K0 + filament_nr);
manage_response(false, false, MMU_UNLOAD_MOVE);
}
else
{
show_preheat_nozzle_warning();
}
}
#endif //MMU_HAS_CUTTER

void mmu_eject_filament(uint8_t filament, bool recover)
{
Expand Down Expand Up @@ -1457,11 +1459,13 @@ 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);

#ifdef MMU_HAS_CUTTER
if (1 == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED))
{
mmu_command(MmuCmd::K0 + tmp_extruder);
manage_response(true, true, MMU_UNLOAD_MOVE);
}
#endif //MMU_HAS_CUTTER

mmu_command(MmuCmd::T0 + tmp_extruder);
manage_response(true, true, MMU_TCODE_MOVE);
Expand Down
2 changes: 2 additions & 0 deletions Firmware/mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ extern bool mmu_check_version();
extern void mmu_show_warning();
extern void lcd_mmu_load_to_nozzle(uint8_t filament_nr);
extern void mmu_eject_filament(uint8_t filament, bool recover);
#ifdef MMU_HAS_CUTTER
extern void mmu_cut_filament(uint8_t filament_nr);
#endif //MMU_HAS_CUTTER
extern void mmu_continue_loading();
extern void mmu_filament_ramming();
extern void mmu_wait_for_heater_blocking();
Expand Down
16 changes: 15 additions & 1 deletion Firmware/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ static void lcd_menu_fails_stats_mmu_total();

static void mmu_fil_eject_menu();
static void mmu_load_to_nozzle_menu();
#ifdef MMU_HAS_CUTTER
static void mmu_cut_filament_menu();
#endif //MMU_HAS_CUTTER

#if defined(TMC2130) || defined(FILAMENT_SENSOR)
static void lcd_menu_fails_stats();
Expand Down Expand Up @@ -2295,6 +2297,7 @@ void lcd_set_fan_check() {
eeprom_update_byte((unsigned char *)EEPROM_FAN_CHECK_ENABLED, fans_check_enabled);
}

#ifdef MMU_HAS_CUTTER
void lcd_cutter_enabled()
{
if (1 == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED))
Expand All @@ -2306,6 +2309,7 @@ void lcd_cutter_enabled()
eeprom_update_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 1);
}
}
#endif //MMU_HAS_CUTTER

void lcd_set_filament_autoload() {
fsensor_autoload_set(!fsensor_autoload_enabled);
Expand Down Expand Up @@ -2536,10 +2540,12 @@ if(current_temperature[0]>(target_temperature[0]*0.95))
menu_submenu(mmu_fil_eject_menu);
break;
case e_FILAMENT_ACTION_mmuCut:
#ifdef MMU_HAS_CUTTER
nLevel=bFilamentPreheatState?1:2;
bFilamentAction=true;
menu_back(nLevel);
menu_submenu(mmu_cut_filament_menu);
#endif //MMU_HAS_CUTTER
break;
case e_FILAMENT_ACTION_none:
break;
Expand Down Expand Up @@ -5220,6 +5226,7 @@ do\
}\
while(0)\

#ifdef MMU_HAS_CUTTER
static bool settingsCutter()
{
if (mmu_enabled)
Expand All @@ -5241,7 +5248,10 @@ do\
{\
if(settingsCutter()) return;\
}\
while(0)\
while(0)
#else
#define SETTINGS_CUTTER
#endif //MMU_HAS_CUTTER

#ifdef TMC2130
#define SETTINGS_SILENT_MODE \
Expand Down Expand Up @@ -5919,6 +5929,7 @@ static void mmu_fil_eject_menu()
}
}

#ifdef MMU_HAS_CUTTER
template <uint8_t filament>
static void mmu_cut_filament()
{
Expand Down Expand Up @@ -5950,6 +5961,7 @@ else {
else mFilamentMenu();
}
}
#endif //MMU_HAS_CUTTER

#ifdef SNMM
static void fil_unload_menu()
Expand Down Expand Up @@ -6423,7 +6435,9 @@ static void lcd_main_menu()
//bFilamentFirstRun=true;
MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), extr_unload_);
MENU_ITEM_SUBMENU_P(_i("Eject filament"), mmu_fil_eject_menu);
#ifdef MMU_HAS_CUTTER
MENU_ITEM_SUBMENU_P(_i("Cut filament"), mmu_cut_filament_menu);
#endif //MMU_HAS_CUTTER
}
else
{
Expand Down
1 change: 1 addition & 0 deletions Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@
#define MMU_REQUIRED_FW_BUILDNR 132
#define MMU_FORCE_STEALTH_MODE
#define MMU_DEBUG //print communication between MMU2 and printer on serial
//#define MMU_HAS_CUTTER

#define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning

Expand Down
1 change: 1 addition & 0 deletions Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@
#define MMU_REQUIRED_FW_BUILDNR 132
#define MMU_FORCE_STEALTH_MODE
#define MMU_DEBUG //print communication between MMU2 and printer on serial
//#define MMU_HAS_CUTTER

#define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning

Expand Down
1 change: 1 addition & 0 deletions Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@
#define MMU_REQUIRED_FW_BUILDNR 132
#define MMU_FORCE_STEALTH_MODE
#define MMU_DEBUG //print communication between MMU2 and printer on serial
//#define MMU_HAS_CUTTER

#define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning

Expand Down
1 change: 1 addition & 0 deletions Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@
#define MMU_REQUIRED_FW_BUILDNR 132
#define MMU_FORCE_STEALTH_MODE
#define MMU_DEBUG //print communication between MMU2 and printer on serial
//#define MMU_HAS_CUTTER

#define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning

Expand Down
1 change: 1 addition & 0 deletions Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@
#define MMU_REQUIRED_FW_BUILDNR 83
#define MMU_HWRESET
#define MMU_DEBUG //print communication between MMU2 and printer on serial
//#define MMU_HAS_CUTTER
#define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning

#endif //__CONFIGURATION_PRUSA_H
1 change: 1 addition & 0 deletions Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@
#define MMU_REQUIRED_FW_BUILDNR 83
#define MMU_HWRESET
#define MMU_DEBUG //print communication between MMU2 and printer on serial
//#define MMU_HAS_CUTTER
#define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning

#endif //__CONFIGURATION_PRUSA_H

0 comments on commit ffe45bd

Please sign in to comment.