Rename autoDeplete to lcd_autoDeplete and make it global. When filament runs out, call M600 AUTO if lcd_autoDeplete is enabled. Shorten finda polling period to 300 ms.
This commit is contained in:
parent
1cdb7a48cb
commit
b08ae95568
|
|
@ -9,6 +9,7 @@
|
||||||
#include "Configuration_prusa.h"
|
#include "Configuration_prusa.h"
|
||||||
#include "fsensor.h"
|
#include "fsensor.h"
|
||||||
#include "cardreader.h"
|
#include "cardreader.h"
|
||||||
|
#include "ultralcd.h"
|
||||||
|
|
||||||
|
|
||||||
extern const char* lcd_display_message_fullscreen_P(const char *msg);
|
extern const char* lcd_display_message_fullscreen_P(const char *msg);
|
||||||
|
|
@ -192,7 +193,7 @@ void mmu_loop(void)
|
||||||
}
|
}
|
||||||
mmu_cmd = 0;
|
mmu_cmd = 0;
|
||||||
}
|
}
|
||||||
else if ((mmu_last_response + 800) < millis()) //request every 800ms
|
else if ((mmu_last_response + 300) < millis()) //request every 300ms
|
||||||
{
|
{
|
||||||
puts_P(PSTR("MMU <= 'P0'"));
|
puts_P(PSTR("MMU <= 'P0'"));
|
||||||
mmu_puts_P(PSTR("P0\n")); //send 'read finda' request
|
mmu_puts_P(PSTR("P0\n")); //send 'read finda' request
|
||||||
|
|
@ -208,7 +209,8 @@ 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
|
||||||
enquecommand_front_P(PSTR("M600")); //save print and run M600 command
|
if (lcd_autoDeplete) enquecommand_front_P(PSTR("M600 AUTO")); //save print and run M600 command
|
||||||
|
else enquecommand_front_P(PSTR("M600")); //save print and run M600 command
|
||||||
}
|
}
|
||||||
mmu_state = 1;
|
mmu_state = 1;
|
||||||
if (mmu_cmd == 0)
|
if (mmu_cmd == 0)
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,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;
|
||||||
static bool autoDeplete;
|
bool lcd_autoDeplete;
|
||||||
|
|
||||||
|
|
||||||
static float manual_feedrate[] = MANUAL_FEEDRATE;
|
static float manual_feedrate[] = MANUAL_FEEDRATE;
|
||||||
|
|
@ -4662,8 +4662,8 @@ while (0)
|
||||||
|
|
||||||
static void auto_deplete_switch()
|
static void auto_deplete_switch()
|
||||||
{
|
{
|
||||||
autoDeplete = !autoDeplete;
|
lcd_autoDeplete = !lcd_autoDeplete;
|
||||||
eeprom_update_byte((unsigned char *)EEPROM_AUTO_DEPLETE, autoDeplete);
|
eeprom_update_byte((unsigned char *)EEPROM_AUTO_DEPLETE, lcd_autoDeplete);
|
||||||
}
|
}
|
||||||
static void lcd_settings_menu()
|
static void lcd_settings_menu()
|
||||||
{
|
{
|
||||||
|
|
@ -4681,7 +4681,7 @@ static void lcd_settings_menu()
|
||||||
|
|
||||||
if (mmu_enabled)
|
if (mmu_enabled)
|
||||||
{
|
{
|
||||||
if (autoDeplete) MENU_ITEM_FUNCTION_P(_i("Auto deplete [on]"), auto_deplete_switch);
|
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);
|
else MENU_ITEM_FUNCTION_P(_i("Auto deplete[off]"), auto_deplete_switch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7070,8 +7070,8 @@ void ultralcd_init()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
uint8_t autoDepleteRaw = eeprom_read_byte(reinterpret_cast<uint8_t*>(EEPROM_AUTO_DEPLETE));
|
uint8_t autoDepleteRaw = eeprom_read_byte(reinterpret_cast<uint8_t*>(EEPROM_AUTO_DEPLETE));
|
||||||
if (0xff == autoDepleteRaw) autoDeplete = false;
|
if (0xff == autoDepleteRaw) lcd_autoDeplete = false;
|
||||||
else autoDeplete = autoDepleteRaw;
|
else lcd_autoDeplete = autoDepleteRaw;
|
||||||
|
|
||||||
}
|
}
|
||||||
lcd_init();
|
lcd_init();
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,7 @@ 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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue