Merge pull request #1304 from mkbel/add_autodeplete_tune
Add autodeplete setting into tune menu.
This commit is contained in:
commit
0d3fd60ed3
|
|
@ -269,7 +269,7 @@ void mmu_loop(void)
|
||||||
if (!mmu_finda && CHECK_FINDA && fsensor_enabled) {
|
if (!mmu_finda && CHECK_FINDA && fsensor_enabled) {
|
||||||
fsensor_stop_and_save_print();
|
fsensor_stop_and_save_print();
|
||||||
enquecommand_front_P(PSTR("FSENSOR_RECOVER")); //then recover
|
enquecommand_front_P(PSTR("FSENSOR_RECOVER")); //then recover
|
||||||
if (lcd_autoDeplete) enquecommand_front_P(PSTR("M600 AUTO")); //save print and run M600 command
|
if (lcd_autoDepleteEnabled()) enquecommand_front_P(PSTR("M600 AUTO")); //save print and run M600 command
|
||||||
else enquecommand_front_P(PSTR("M600")); //save print and run M600 command
|
else enquecommand_front_P(PSTR("M600")); //save print and run M600 command
|
||||||
}
|
}
|
||||||
mmu_state = 1;
|
mmu_state = 1;
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ unsigned long display_time; //just timer for showing pid finished message on lcd
|
||||||
float pid_temp = DEFAULT_PID_TEMP;
|
float pid_temp = DEFAULT_PID_TEMP;
|
||||||
|
|
||||||
static bool forceMenuExpire = false;
|
static bool forceMenuExpire = false;
|
||||||
bool lcd_autoDeplete;
|
static bool lcd_autoDeplete;
|
||||||
|
|
||||||
|
|
||||||
static float manual_feedrate[] = MANUAL_FEEDRATE;
|
static float manual_feedrate[] = MANUAL_FEEDRATE;
|
||||||
|
|
@ -4423,6 +4423,11 @@ static void lcd_wizard_load()
|
||||||
gcode_M701();
|
gcode_M701();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool lcd_autoDepleteEnabled()
|
||||||
|
{
|
||||||
|
return (lcd_autoDeplete && fsensor_enabled);
|
||||||
|
}
|
||||||
|
|
||||||
//! @brief Printer first run wizard (Selftest and calibration)
|
//! @brief Printer first run wizard (Selftest and calibration)
|
||||||
//!
|
//!
|
||||||
//!
|
//!
|
||||||
|
|
@ -4685,6 +4690,39 @@ while(0)
|
||||||
#define SETTINGS_FILAMENT_SENSOR do{}while(0)
|
#define SETTINGS_FILAMENT_SENSOR do{}while(0)
|
||||||
#endif //FILAMENT_SENSOR
|
#endif //FILAMENT_SENSOR
|
||||||
|
|
||||||
|
static void auto_deplete_switch()
|
||||||
|
{
|
||||||
|
lcd_autoDeplete = !lcd_autoDeplete;
|
||||||
|
eeprom_update_byte((unsigned char *)EEPROM_AUTO_DEPLETE, lcd_autoDeplete);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool settingsAutoDeplete()
|
||||||
|
{
|
||||||
|
if (mmu_enabled)
|
||||||
|
{
|
||||||
|
if (!fsensor_enabled)
|
||||||
|
{
|
||||||
|
if (menu_item_text_P(_i("Auto deplete[N/A]"))) return true;
|
||||||
|
}
|
||||||
|
else if (lcd_autoDeplete)
|
||||||
|
{
|
||||||
|
if (menu_item_function_P(_i("Auto deplete [on]"), auto_deplete_switch)) return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (menu_item_function_P(_i("Auto deplete[off]"), auto_deplete_switch)) return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define SETTINGS_AUTO_DEPLETE \
|
||||||
|
do\
|
||||||
|
{\
|
||||||
|
if(settingsAutoDeplete()) return;\
|
||||||
|
}\
|
||||||
|
while(0)\
|
||||||
|
|
||||||
#ifdef TMC2130
|
#ifdef TMC2130
|
||||||
#define SETTINGS_SILENT_MODE \
|
#define SETTINGS_SILENT_MODE \
|
||||||
do\
|
do\
|
||||||
|
|
@ -4792,12 +4830,6 @@ do\
|
||||||
}\
|
}\
|
||||||
while (0)
|
while (0)
|
||||||
|
|
||||||
static void auto_deplete_switch()
|
|
||||||
{
|
|
||||||
lcd_autoDeplete = !lcd_autoDeplete;
|
|
||||||
eeprom_update_byte((unsigned char *)EEPROM_AUTO_DEPLETE, lcd_autoDeplete);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void lcd_settings_menu()
|
static void lcd_settings_menu()
|
||||||
{
|
{
|
||||||
EEPROM_read(EEPROM_SILENT, (uint8_t*)&SilentModeMenu, sizeof(SilentModeMenu));
|
EEPROM_read(EEPROM_SILENT, (uint8_t*)&SilentModeMenu, sizeof(SilentModeMenu));
|
||||||
|
|
@ -4812,11 +4844,7 @@ static void lcd_settings_menu()
|
||||||
|
|
||||||
SETTINGS_FILAMENT_SENSOR;
|
SETTINGS_FILAMENT_SENSOR;
|
||||||
|
|
||||||
if (mmu_enabled)
|
SETTINGS_AUTO_DEPLETE;
|
||||||
{
|
|
||||||
if (lcd_autoDeplete) MENU_ITEM_FUNCTION_P(_i("Auto deplete [on]"), auto_deplete_switch);
|
|
||||||
else MENU_ITEM_FUNCTION_P(_i("Auto deplete[off]"), auto_deplete_switch);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fans_check_enabled == true)
|
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
|
MENU_ITEM_FUNCTION_P(_i("Fans check [on]"), lcd_set_fan_check);////MSG_FANS_CHECK_ON c=17 r=1
|
||||||
|
|
@ -5928,6 +5956,8 @@ static void lcd_tune_menu()
|
||||||
}
|
}
|
||||||
#endif //FILAMENT_SENSOR
|
#endif //FILAMENT_SENSOR
|
||||||
|
|
||||||
|
SETTINGS_AUTO_DEPLETE;
|
||||||
|
|
||||||
#ifdef TMC2130
|
#ifdef TMC2130
|
||||||
if(!farm_mode)
|
if(!farm_mode)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,6 @@ extern int8_t SilentModeMenu;
|
||||||
|
|
||||||
extern bool cancel_heatup;
|
extern bool cancel_heatup;
|
||||||
extern bool isPrintPaused;
|
extern bool isPrintPaused;
|
||||||
extern bool lcd_autoDeplete;
|
|
||||||
|
|
||||||
|
|
||||||
void lcd_ignore_click(bool b=true);
|
void lcd_ignore_click(bool b=true);
|
||||||
|
|
@ -174,6 +173,7 @@ void lcd_set_progress();
|
||||||
void lcd_language();
|
void lcd_language();
|
||||||
|
|
||||||
void lcd_wizard();
|
void lcd_wizard();
|
||||||
|
bool lcd_autoDepleteEnabled();
|
||||||
|
|
||||||
//! @brief Wizard state
|
//! @brief Wizard state
|
||||||
enum class WizState : uint8_t
|
enum class WizState : uint8_t
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue