|
@@ -59,7 +59,9 @@ int clock_interval = 0;
|
|
|
|
|
|
static void lcd_sd_updir();
|
|
|
static void lcd_mesh_bed_leveling_settings();
|
|
|
+#ifdef LCD_BL_PIN
|
|
|
static void lcd_backlight_menu();
|
|
|
+#endif
|
|
|
|
|
|
int8_t ReInitLCD = 0;
|
|
|
uint8_t scrollstuff = 0;
|
|
@@ -123,7 +125,9 @@ static void lcd_tune_menu();
|
|
|
static void lcd_settings_menu();
|
|
|
static void lcd_calibration_menu();
|
|
|
static void lcd_control_temperature_menu();
|
|
|
+#ifdef TMC2130
|
|
|
static void lcd_settings_linearity_correction_menu_save();
|
|
|
+#endif
|
|
|
static void prusa_stat_printerstatus(int _status);
|
|
|
static void prusa_stat_farm_number();
|
|
|
static void prusa_stat_diameter();
|
|
@@ -160,7 +164,6 @@ static void lcd_selftest_v();
|
|
|
#ifdef TMC2130
|
|
|
static void reset_crash_det(unsigned char axis);
|
|
|
static bool lcd_selfcheck_axis_sg(unsigned char axis);
|
|
|
-static bool lcd_selfcheck_axis(int _axis, int _travel);
|
|
|
#else
|
|
|
static bool lcd_selfcheck_axis(int _axis, int _travel);
|
|
|
static bool lcd_selfcheck_pulleys(int axis);
|
|
@@ -248,7 +251,9 @@ static void fil_unload_menu();
|
|
|
#endif // SNMM || SNMM_V2
|
|
|
static void lcd_disable_farm_mode();
|
|
|
static void lcd_set_fan_check();
|
|
|
+#ifdef MMU_HAS_CUTTER
|
|
|
static void lcd_cutter_enabled();
|
|
|
+#endif
|
|
|
#ifdef SNMM
|
|
|
static char snmm_stop_print_menu();
|
|
|
#endif //SNMM
|
|
@@ -635,7 +640,7 @@ void lcdui_print_status_line(void)
|
|
|
case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status
|
|
|
if (custom_message_state > 10) {
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- lcd_space(20);
|
|
|
+ lcd_space(LCD_WIDTH);
|
|
|
lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO));
|
|
|
lcd_puts_P(PSTR(" : "));
|
|
|
lcd_print(custom_message_state-10);
|
|
@@ -690,7 +695,7 @@ void lcdui_print_status_line(void)
|
|
|
}
|
|
|
|
|
|
// Fill the rest of line to have nice and clean output
|
|
|
- for(int fillspace = 0; fillspace < 20; fillspace++)
|
|
|
+ for(int fillspace = 0; fillspace < LCD_WIDTH; fillspace++)
|
|
|
if ((lcd_status_message[fillspace] <= 31 ))
|
|
|
lcd_print(' ');
|
|
|
}
|
|
@@ -2090,7 +2095,7 @@ if(lcd_clicked())
|
|
|
{
|
|
|
case FilamentAction::AutoLoad:
|
|
|
eFilamentAction=FilamentAction::None; // i.e. non-autoLoad
|
|
|
- // no break
|
|
|
+ // FALLTHRU
|
|
|
case FilamentAction::Load:
|
|
|
loading_flag=true;
|
|
|
enquecommand_P(PSTR("M701")); // load filament
|
|
@@ -2201,14 +2206,21 @@ void mFilamentItem(uint16_t nTemp, uint16_t nTempBed)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (!bFilamentWaitingFlag)
|
|
|
+ if (!bFilamentWaitingFlag || lcd_draw_update)
|
|
|
{
|
|
|
- // First run after the filament preheat selection:
|
|
|
- // setup the fixed LCD parts and raise Z as we wait
|
|
|
+ // First entry from another menu OR first run after the filament preheat selection. Use
|
|
|
+ // bFilamentWaitingFlag to distinguish: this flag is reset exactly once when entering
|
|
|
+ // the menu and is used to raise the carriage *once*. In other cases, the LCD has been
|
|
|
+ // modified elsewhere and needs to be redrawn in full.
|
|
|
+
|
|
|
+ // reset bFilamentWaitingFlag immediately to avoid re-entry from raise_z_above()!
|
|
|
+ bool once = !bFilamentWaitingFlag;
|
|
|
bFilamentWaitingFlag = true;
|
|
|
|
|
|
- lcd_clear();
|
|
|
+ // also force-enable lcd_draw_update (might be 0 when called from outside a menu)
|
|
|
lcd_draw_update = 1;
|
|
|
+
|
|
|
+ lcd_clear();
|
|
|
lcd_puts_at_P(0, 3, _T(MSG_CANCEL)); ////MSG_CANCEL
|
|
|
|
|
|
lcd_set_cursor(0, 1);
|
|
@@ -2218,12 +2230,12 @@ void mFilamentItem(uint16_t nTemp, uint16_t nTempBed)
|
|
|
case FilamentAction::AutoLoad:
|
|
|
case FilamentAction::MmuLoad:
|
|
|
lcd_puts_P(_i("Preheating to load")); ////MSG_PREHEATING_TO_LOAD c=20
|
|
|
- raise_z_above(MIN_Z_FOR_LOAD);
|
|
|
+ if (once) raise_z_above(MIN_Z_FOR_LOAD);
|
|
|
break;
|
|
|
case FilamentAction::UnLoad:
|
|
|
case FilamentAction::MmuUnLoad:
|
|
|
lcd_puts_P(_i("Preheating to unload")); ////MSG_PREHEATING_TO_UNLOAD c=20
|
|
|
- raise_z_above(MIN_Z_FOR_UNLOAD);
|
|
|
+ if (once) raise_z_above(MIN_Z_FOR_UNLOAD);
|
|
|
break;
|
|
|
case FilamentAction::MmuEject:
|
|
|
lcd_puts_P(_i("Preheating to eject")); ////MSG_PREHEATING_TO_EJECT c=20
|
|
@@ -2419,7 +2431,7 @@ void lcd_change_success() {
|
|
|
|
|
|
static void lcd_loading_progress_bar(uint16_t loading_time_ms) {
|
|
|
|
|
|
- for (uint_least8_t i = 0; i < 20; i++) {
|
|
|
+ for (uint_least8_t i = 0; i < LCD_WIDTH; i++) {
|
|
|
lcd_putc_at(i, 3, '.');
|
|
|
//loading_time_ms/20 delay
|
|
|
for (uint_least8_t j = 0; j < 5; j++) {
|
|
@@ -3332,10 +3344,10 @@ static const char* lcd_display_message_fullscreen_nonBlocking_P(const char *msg,
|
|
|
// End of the message.
|
|
|
break;
|
|
|
lcd_set_cursor(0, row);
|
|
|
- uint8_t linelen = min(strlen_P(msg), 20);
|
|
|
+ uint8_t linelen = min(strlen_P(msg), LCD_WIDTH);
|
|
|
const char *msgend2 = msg + linelen;
|
|
|
msgend = msgend2;
|
|
|
- if (row == 3 && linelen == 20) {
|
|
|
+ if (row == 3 && linelen == LCD_WIDTH) {
|
|
|
// Last line of the display, full line shall be displayed.
|
|
|
// Find out, whether this message will be split into multiple screens.
|
|
|
while (pgm_is_whitespace(msgend))
|
|
@@ -5999,7 +6011,7 @@ char reset_menu() {
|
|
|
int8_t enc_dif = 0;
|
|
|
char cursor_pos = 0;
|
|
|
|
|
|
- const char *const item[items_no] PROGMEM = {PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data")
|
|
|
+ const char *const item[items_no] = {PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data")
|
|
|
#ifdef SNMM
|
|
|
, PSTR("Bowden length")
|
|
|
#endif
|
|
@@ -7134,8 +7146,8 @@ void lcd_sdcard_menu()
|
|
|
_md->fileCnt = card.getnrfilenames();
|
|
|
_md->sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT);
|
|
|
_md->menuState = _standard;
|
|
|
- // FALLTHRU
|
|
|
}
|
|
|
+ // FALLTHRU
|
|
|
case _standard: //normal menu structure.
|
|
|
{
|
|
|
if (!_md->lcd_scrollTimer.running()) //if the timer is not running, then the menu state was just switched, so redraw the screen.
|
|
@@ -7400,7 +7412,7 @@ bool lcd_selftest()
|
|
|
break;
|
|
|
case FanCheck::SwappedFan:
|
|
|
_swapped_fan = true;
|
|
|
- // no break
|
|
|
+ // FALLTHRU
|
|
|
default:
|
|
|
_result = true;
|
|
|
break;
|
|
@@ -7423,7 +7435,7 @@ bool lcd_selftest()
|
|
|
break;
|
|
|
case FanCheck::SwappedFan:
|
|
|
_swapped_fan = true;
|
|
|
- // no break
|
|
|
+ // FALLTHRU
|
|
|
default:
|
|
|
_result = true;
|
|
|
break;
|
|
@@ -8854,25 +8866,28 @@ void menu_lcd_lcdupdate_func(void)
|
|
|
lcd_draw_update = 2;
|
|
|
lcd_oldcardstatus = IS_SD_INSERTED;
|
|
|
lcd_refresh(); // to maybe revive the LCD if static electricity killed it.
|
|
|
- backlight_wake();
|
|
|
+ backlight_wake();
|
|
|
if (lcd_oldcardstatus)
|
|
|
{
|
|
|
- card.initsd();
|
|
|
- LCD_MESSAGERPGM(_T(WELCOME_MSG));
|
|
|
- bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function
|
|
|
- menu_submenu(lcd_sdcard_menu);
|
|
|
- //get_description();
|
|
|
+ if (!card.cardOK)
|
|
|
+ {
|
|
|
+ card.initsd(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back()
|
|
|
+ card.presort_flag = true; //force sorting of the SD menu
|
|
|
+ }
|
|
|
+ LCD_MESSAGERPGM(_T(WELCOME_MSG));
|
|
|
+ bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function
|
|
|
+ menu_submenu(lcd_sdcard_menu);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if(menu_menu==lcd_sdcard_menu)
|
|
|
- menu_back();
|
|
|
+ if(menu_menu==lcd_sdcard_menu)
|
|
|
+ menu_back();
|
|
|
card.release();
|
|
|
LCD_MESSAGERPGM(_i("Card removed"));////MSG_SD_REMOVED c=20
|
|
|
}
|
|
|
}
|
|
|
#endif//CARDINSERTED
|
|
|
- backlight_update();
|
|
|
+ backlight_update();
|
|
|
if (lcd_next_update_millis < _millis())
|
|
|
{
|
|
|
if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP)
|