|
@@ -105,7 +105,7 @@ int lcd_commands_step=0;
|
|
|
bool isPrintPaused = false;
|
|
|
uint8_t farm_mode = 0;
|
|
|
int farm_no = 0;
|
|
|
-int farm_timer = 30;
|
|
|
+int farm_timer = 8;
|
|
|
int farm_status = 0;
|
|
|
unsigned long allert_timer = millis();
|
|
|
bool printer_connected = true;
|
|
@@ -408,15 +408,15 @@ static void lcd_status_screen()
|
|
|
farm_timer--;
|
|
|
if (farm_timer < 1)
|
|
|
{
|
|
|
- farm_timer = 180;
|
|
|
+ farm_timer = 10;
|
|
|
prusa_statistics(0);
|
|
|
}
|
|
|
switch (farm_timer)
|
|
|
{
|
|
|
- case 45:
|
|
|
+ case 8:
|
|
|
prusa_statistics(21);
|
|
|
break;
|
|
|
- case 10:
|
|
|
+ case 5:
|
|
|
if (IS_SD_PRINTING)
|
|
|
{
|
|
|
prusa_statistics(20);
|
|
@@ -589,6 +589,251 @@ void lcd_commands()
|
|
|
lcd_commands_step = 3;
|
|
|
}
|
|
|
}
|
|
|
+#ifdef SNMM
|
|
|
+ if (lcd_commands_type == LCD_COMMAND_V2_CAL)
|
|
|
+ {
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
|
+ if (lcd_commands_step == 0)
|
|
|
+ {
|
|
|
+ lcd_commands_step = 6;
|
|
|
+ }
|
|
|
+ if (lcd_commands_step == 6 && !blocks_queued() && cmd_buffer_empty())
|
|
|
+ {
|
|
|
+ enquecommand_P(PSTR("M107"));
|
|
|
+ enquecommand_P(PSTR("M104 S210"));
|
|
|
+ enquecommand_P(PSTR("M140 S55"));
|
|
|
+ enquecommand_P(PSTR("M190 S55"));
|
|
|
+ enquecommand_P(PSTR("M109 S210"));
|
|
|
+ enquecommand_P(PSTR("T0"));
|
|
|
+ enquecommand_P(PSTR("M117 First layer cal."));
|
|
|
+ enquecommand_P(PSTR("G87")); //sets calibration status
|
|
|
+ enquecommand_P(PSTR("G28"));
|
|
|
+ enquecommand_P(PSTR("G21")); //set units to millimeters
|
|
|
+ enquecommand_P(PSTR("G90")); //use absolute coordinates
|
|
|
+ enquecommand_P(PSTR("M83")); //use relative distances for extrusion
|
|
|
+ enquecommand_P(PSTR("G92 E0"));
|
|
|
+ enquecommand_P(PSTR("M203 E100"));
|
|
|
+ enquecommand_P(PSTR("M92 E140"));
|
|
|
+ lcd_commands_step = 5;
|
|
|
+ }
|
|
|
+ if (lcd_commands_step == 5 && !blocks_queued() && cmd_buffer_empty())
|
|
|
+ {
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
|
+ enquecommand_P(PSTR("G1 Z0.250 F7200.000"));
|
|
|
+ enquecommand_P(PSTR("G1 X50.0 E80.0 F1000.0));
|
|
|
+ nquecommand_P(PSTR("G1 X160.0 E20.0 F1000.0));
|
|
|
+ enquecommand_P(PSTR("G1 Z0.200 F7200.000));
|
|
|
+ enquecommand_P(PSTR("G1 X220.0 E13 F1000.0"));
|
|
|
+ enquecommand_P(PSTR("G1 X240.0 E0 F1000.0"));
|
|
|
+ enquecommand_P(PSTR("G92 E0.0"));
|
|
|
+ enquecommand_P(PSTR("G21"));
|
|
|
+ enquecommand_P(PSTR("G90"));
|
|
|
+ enquecommand_P(PSTR("M83"));
|
|
|
+ enquecommand_P(PSTR("G1 E-4 F2100.00000"));
|
|
|
+ enquecommand_P(PSTR("G1 Z0.150 F7200.000"));
|
|
|
+ enquecommand_P(PSTR("M204 S1000"));
|
|
|
+ enquecommand_P(PSTR("G1 F4000"));
|
|
|
+
|
|
|
+ lcd_implementation_clear();
|
|
|
+ lcd_goto_menu(lcd_babystep_z, 0, false);
|
|
|
+
|
|
|
+
|
|
|
+ lcd_commands_step = 4;
|
|
|
+ }
|
|
|
+ if (lcd_commands_step == 4 && !blocks_queued() && cmd_buffer_empty()) //draw meander
|
|
|
+ {
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
|
+
|
|
|
+
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y155"));
|
|
|
+ enquecommand_P(PSTR("G1 X60 Y155 E4"));
|
|
|
+ enquecommand_P(PSTR("G1 F1080"));
|
|
|
+ enquecommand_P(PSTR("G1 X75 Y155 E2.5"));
|
|
|
+ enquecommand_P(PSTR("G1 X100 Y155 E2"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y155 E2.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y135 E0.66174"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y135 E3.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y115 E0.49386"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y115 E3.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y95 E0.49386"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y95 E3.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y75 E0.49386"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y75 E3.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y55 E0.49386"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y55 E3.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 E - 0.07500 F2100.00000"));
|
|
|
+ lcd_commands_step = 3;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (lcd_commands_step == 3 && !blocks_queued() && cmd_buffer_empty())
|
|
|
+ {
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
|
+
|
|
|
+ enquecommand_P(PSTR("G4 S0"));
|
|
|
+ enquecommand_P(PSTR("G1 E-4 F2100.00000"));
|
|
|
+ enquecommand_P(PSTR("G1 Z0.5 F7200.000"));
|
|
|
+ enquecommand_P(PSTR("G1 X245 Y1"));
|
|
|
+ enquecommand_P(PSTR("G1 X240 E4"));
|
|
|
+ enquecommand_P(PSTR("G1 F4000"));
|
|
|
+ enquecommand_P(PSTR("G1 X190 E2.7"));
|
|
|
+ enquecommand_P(PSTR("G1 F4600"));
|
|
|
+ enquecommand_P(PSTR("G1 X110 E2.8"));
|
|
|
+ enquecommand_P(PSTR("G1 F5200"));
|
|
|
+ enquecommand_P(PSTR("G1 X40 E3"));
|
|
|
+ enquecommand_P(PSTR("G1 E-15.0000 F5000"));
|
|
|
+ enquecommand_P(PSTR("G1 E-50.0000 F5400"));
|
|
|
+ enquecommand_P(PSTR("G1 E-15.0000 F3000"));
|
|
|
+ enquecommand_P(PSTR("G1 E-12.0000 F2000"));
|
|
|
+ enquecommand_P(PSTR("G1 F1600"));
|
|
|
+
|
|
|
+ lcd_commands_step = 2;
|
|
|
+ }
|
|
|
+ if (lcd_commands_step == 2 && !blocks_queued() && cmd_buffer_empty())
|
|
|
+ {
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
|
+
|
|
|
+ enquecommand_P(PSTR("G1 X0 Y1 E3.0000"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y1 E-5.0000"));
|
|
|
+ enquecommand_P(PSTR("G1 F2000"));
|
|
|
+ enquecommand_P(PSTR("G1 X0 Y1 E5.0000"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y1 E-5.0000"));
|
|
|
+ enquecommand_P(PSTR("G1 F2400"));
|
|
|
+ enquecommand_P(PSTR("G1 X0 Y1 E5.0000"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y1 E - 5.0000"));
|
|
|
+ enquecommand_P(PSTR("G1 F2400"));
|
|
|
+ enquecommand_P(PSTR("G1 X0 Y1 E5.0000"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y1 E-3.0000"));
|
|
|
+ enquecommand_P(PSTR("G4 S0"));
|
|
|
+ enquecommand_P(PSTR("M107"));
|
|
|
+ enquecommand_P(PSTR("M104 S0"));
|
|
|
+ enquecommand_P(PSTR("M140 S0"));
|
|
|
+ enquecommand_P(PSTR("G1 X10 Y180 F4000"));
|
|
|
+ enquecommand_P(PSTR("G1 Z10 F1300.000"));
|
|
|
+ enquecommand_P(PSTR("M84"));
|
|
|
+
|
|
|
+ lcd_commands_step = 1;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (lcd_commands_step == 1 && !blocks_queued() && cmd_buffer_empty())
|
|
|
+ {
|
|
|
+ lcd_setstatuspgm(WELCOME_MSG);
|
|
|
+ lcd_commands_step = 0;
|
|
|
+ lcd_commands_type = 0;
|
|
|
+ if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) == 1) {
|
|
|
+ lcd_wizard(10);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+#else //if not SNMM
|
|
|
+
|
|
|
+
|
|
|
+ if (lcd_commands_type == LCD_COMMAND_V2_CAL)
|
|
|
+ {
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
|
+ if (lcd_commands_step == 0)
|
|
|
+ {
|
|
|
+ lcd_commands_step = 5;
|
|
|
+ }
|
|
|
+ if (lcd_commands_step == 5 && !blocks_queued() && cmd_buffer_empty())
|
|
|
+ {
|
|
|
+ enquecommand_P(PSTR("M107"));
|
|
|
+ enquecommand_P(PSTR("M104 S210"));
|
|
|
+ enquecommand_P(PSTR("M140 S55"));
|
|
|
+ enquecommand_P(PSTR("M190 S55"));
|
|
|
+ enquecommand_P(PSTR("M109 S210"));
|
|
|
+ enquecommand_P(PSTR("M117 First layer cal."));
|
|
|
+ enquecommand_P(PSTR("G87")); //sets calibration status
|
|
|
+ enquecommand_P(PSTR("G28"));
|
|
|
+ enquecommand_P(PSTR("G92 E0.0"));
|
|
|
+ lcd_commands_step = 4;
|
|
|
+ }
|
|
|
+ if (lcd_commands_step == 4 && !blocks_queued() && cmd_buffer_empty())
|
|
|
+ {
|
|
|
+
|
|
|
+ lcd_implementation_clear();
|
|
|
+ lcd_goto_menu(lcd_babystep_z, 0, false);
|
|
|
+ enquecommand_P(PSTR("G1 X60.0 E9.0 F1000.0")); //intro line
|
|
|
+ enquecommand_P(PSTR("G1 X100.0 E12.5 F1000.0")); //intro line
|
|
|
+ enquecommand_P(PSTR("G92 E0.0"));
|
|
|
+ enquecommand_P(PSTR("G21")); //set units to millimeters
|
|
|
+ enquecommand_P(PSTR("G90")); //use absolute coordinates
|
|
|
+ enquecommand_P(PSTR("M83")); //use relative distances for extrusion
|
|
|
+ enquecommand_P(PSTR("G1 E - 1.50000 F2100.00000"));
|
|
|
+ enquecommand_P(PSTR("G1 Z0.150 F7200.000"));
|
|
|
+ enquecommand_P(PSTR("M204 S1000")); //set acceleration
|
|
|
+ enquecommand_P(PSTR("G1 F4000"));
|
|
|
+ lcd_commands_step = 3;
|
|
|
+ }
|
|
|
+ if (lcd_commands_step == 3 && !blocks_queued() && cmd_buffer_empty()) //draw meander
|
|
|
+ {
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
|
+
|
|
|
+
|
|
|
+ //just opposite direction
|
|
|
+ /*enquecommand_P(PSTR("G1 X50 Y55"));
|
|
|
+ enquecommand_P(PSTR("G1 F1080"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y55 E3.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y75 E0.49386"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y75 E3.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y95 E0.49386"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y95 E3.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y115 E0.49386"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y115 E3.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y135 E0.49386"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y135 E3.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y155 E0.66174"));
|
|
|
+ enquecommand_P(PSTR("G1 X100 Y155 E2.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X75 Y155 E2"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y155 E2.5"));
|
|
|
+ enquecommand_P(PSTR("G1 E - 0.07500 F2100.00000"));*/
|
|
|
+
|
|
|
+
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y155"));
|
|
|
+ enquecommand_P(PSTR("G1 F1080"));
|
|
|
+ enquecommand_P(PSTR("G1 X75 Y155 E2.5"));
|
|
|
+ enquecommand_P(PSTR("G1 X100 Y155 E2"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y155 E2.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y135 E0.66174"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y135 E3.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y115 E0.49386"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y115 E3.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y95 E0.49386"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y95 E3.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y75 E0.49386"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y75 E3.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 X200 Y55 E0.49386"));
|
|
|
+ enquecommand_P(PSTR("G1 X50 Y55 E3.62773"));
|
|
|
+ enquecommand_P(PSTR("G1 E - 0.07500 F2100.00000"));
|
|
|
+ lcd_commands_step = 2;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (lcd_commands_step == 2 && !blocks_queued() && cmd_buffer_empty())
|
|
|
+ {
|
|
|
+ lcd_timeoutToStatus = millis() + LCD_TIMEOUT_TO_STATUS;
|
|
|
+ enquecommand_P(PSTR("M107")); //turn off printer fan
|
|
|
+ enquecommand_P(PSTR("M104 S0")); // turn off temperature
|
|
|
+ enquecommand_P(PSTR("M140 S0")); // turn off heatbed
|
|
|
+ enquecommand_P(PSTR("G1 Z10 F1300.000"));
|
|
|
+ enquecommand_P(PSTR("G1 X10 Y180 F4000")); //home X axis
|
|
|
+ enquecommand_P(PSTR("M84"));// disable motors
|
|
|
+ lcd_commands_step = 1;
|
|
|
+ }
|
|
|
+ if (lcd_commands_step == 1 && !blocks_queued() && cmd_buffer_empty())
|
|
|
+ {
|
|
|
+ lcd_setstatuspgm(WELCOME_MSG);
|
|
|
+ lcd_commands_step = 0;
|
|
|
+ lcd_commands_type = 0;
|
|
|
+ if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) == 1) {
|
|
|
+ lcd_wizard(10);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+#endif // not SNMM
|
|
|
|
|
|
if (lcd_commands_type == LCD_COMMAND_STOP_PRINT) /// stop print
|
|
|
{
|
|
@@ -1283,13 +1528,14 @@ void lcd_menu_statistics()
|
|
|
lcd.print(itostr3(_days));
|
|
|
|
|
|
|
|
|
-
|
|
|
+ KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
while (!lcd_clicked())
|
|
|
{
|
|
|
manage_heater();
|
|
|
manage_inactivity(true);
|
|
|
delay(100);
|
|
|
}
|
|
|
+ KEEPALIVE_STATE(NOT_BUSY);
|
|
|
|
|
|
lcd_quick_feedback();
|
|
|
lcd_return_to_status();
|
|
@@ -1367,6 +1613,7 @@ void lcd_service_mode_show_result() {
|
|
|
} else lcd_print_at_PGM(11, i + 1, PSTR("N/A"));
|
|
|
}
|
|
|
delay_keep_alive(500);
|
|
|
+ KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
while (!lcd_clicked()) {
|
|
|
delay_keep_alive(100);
|
|
|
}
|
|
@@ -1393,6 +1640,7 @@ void lcd_service_mode_show_result() {
|
|
|
while (!lcd_clicked()) {
|
|
|
delay_keep_alive(100);
|
|
|
}
|
|
|
+ KEEPALIVE_STATE(NOT_BUSY);
|
|
|
delay_keep_alive(500);
|
|
|
lcd_set_custom_characters_arrows();
|
|
|
lcd_return_to_status();
|
|
@@ -1848,13 +2096,13 @@ const char* lcd_display_message_fullscreen_P(const char *msg, uint8_t &nlines)
|
|
|
}
|
|
|
|
|
|
if (multi_screen) {
|
|
|
- // Display the "next screen" indicator character.
|
|
|
- // lcd_set_custom_characters_arrows();
|
|
|
- lcd_set_custom_characters_nextpage();
|
|
|
- lcd.setCursor(19, 3);
|
|
|
+ // Display the "next screen" indicator character.
|
|
|
+ // lcd_set_custom_characters_arrows();
|
|
|
+ lcd_set_custom_characters_nextpage();
|
|
|
+ lcd.setCursor(19, 3);
|
|
|
// Display the down arrow.
|
|
|
lcd.print(char(1));
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
nlines = row;
|
|
|
return multi_screen ? msgend : NULL;
|
|
@@ -1865,8 +2113,15 @@ void lcd_show_fullscreen_message_and_wait_P(const char *msg)
|
|
|
const char *msg_next = lcd_display_message_fullscreen_P(msg);
|
|
|
bool multi_screen = msg_next != NULL;
|
|
|
|
|
|
+ lcd_set_custom_characters_nextpage();
|
|
|
+ KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
// Until confirmed by a button click.
|
|
|
for (;;) {
|
|
|
+ if (!multi_screen) {
|
|
|
+ lcd.setCursor(19, 3);
|
|
|
+ // Display the confirm char.
|
|
|
+ lcd.print(char(2));
|
|
|
+ }
|
|
|
// Wait for 5 seconds before displaying the next text.
|
|
|
for (uint8_t i = 0; i < 100; ++ i) {
|
|
|
delay_keep_alive(50);
|
|
@@ -1874,19 +2129,30 @@ void lcd_show_fullscreen_message_and_wait_P(const char *msg)
|
|
|
while (lcd_clicked()) ;
|
|
|
delay(10);
|
|
|
while (lcd_clicked()) ;
|
|
|
+ lcd_set_custom_characters();
|
|
|
+ lcd_update_enable(true);
|
|
|
+ lcd_update(2);
|
|
|
+ KEEPALIVE_STATE(IN_HANDLER);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
if (multi_screen) {
|
|
|
- if (msg_next == NULL)
|
|
|
- msg_next = msg;
|
|
|
+ if (msg_next == NULL)
|
|
|
+ msg_next = msg;
|
|
|
msg_next = lcd_display_message_fullscreen_P(msg_next);
|
|
|
- }
|
|
|
+ if (msg_next == NULL) {
|
|
|
+
|
|
|
+ lcd.setCursor(19, 3);
|
|
|
+ // Display the confirm char.
|
|
|
+ lcd.print(char(2));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void lcd_wait_for_click()
|
|
|
{
|
|
|
+ KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
for (;;) {
|
|
|
manage_heater();
|
|
|
manage_inactivity(true);
|
|
@@ -1894,14 +2160,81 @@ void lcd_wait_for_click()
|
|
|
while (lcd_clicked()) ;
|
|
|
delay(10);
|
|
|
while (lcd_clicked()) ;
|
|
|
+ KEEPALIVE_STATE(IN_HANDLER);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting, bool default_yes)
|
|
|
+int8_t lcd_show_multiscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting, bool default_yes) //currently just max. n*4 + 3 lines supported (set in language header files)
|
|
|
{
|
|
|
+ const char *msg_next = lcd_display_message_fullscreen_P(msg);
|
|
|
+ bool multi_screen = msg_next != NULL;
|
|
|
+ bool yes = default_yes ? true : false;
|
|
|
+
|
|
|
+ // Wait for user confirmation or a timeout.
|
|
|
+ unsigned long previous_millis_cmd = millis();
|
|
|
+ int8_t enc_dif = encoderDiff;
|
|
|
+ KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
+ for (;;) {
|
|
|
+ for (uint8_t i = 0; i < 100; ++i) {
|
|
|
+ delay_keep_alive(50);
|
|
|
+ if (allow_timeouting && millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS)
|
|
|
+ return -1;
|
|
|
+ manage_heater();
|
|
|
+ manage_inactivity(true);
|
|
|
+
|
|
|
+ if (abs(enc_dif - encoderDiff) > 4) {
|
|
|
+ if (msg_next == NULL) {
|
|
|
+ lcd.setCursor(0, 3);
|
|
|
+ if (enc_dif < encoderDiff && yes) {
|
|
|
+ lcd_printPGM((PSTR(" ")));
|
|
|
+ lcd.setCursor(7, 3);
|
|
|
+ lcd_printPGM((PSTR(">")));
|
|
|
+ yes = false;
|
|
|
+ }
|
|
|
+ else if (enc_dif > encoderDiff && !yes) {
|
|
|
+ lcd_printPGM((PSTR(">")));
|
|
|
+ lcd.setCursor(7, 3);
|
|
|
+ lcd_printPGM((PSTR(" ")));
|
|
|
+ yes = true;
|
|
|
+ }
|
|
|
+ enc_dif = encoderDiff;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ break; //turning knob skips waiting loop
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (lcd_clicked()) {
|
|
|
+ while (lcd_clicked());
|
|
|
+ delay(10);
|
|
|
+ while (lcd_clicked());
|
|
|
+ KEEPALIVE_STATE(IN_HANDLER);
|
|
|
+ if(msg_next == NULL) return yes;
|
|
|
+ else break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (multi_screen) {
|
|
|
+ if (msg_next == NULL) {
|
|
|
+ msg_next = msg;
|
|
|
+ }
|
|
|
+ msg_next = lcd_display_message_fullscreen_P(msg_next);
|
|
|
+ }
|
|
|
+ if (msg_next == NULL){
|
|
|
+ lcd.setCursor(0, 3);
|
|
|
+ if (yes) lcd_printPGM(PSTR(">"));
|
|
|
+ lcd.setCursor(1, 3);
|
|
|
+ lcd_printPGM(MSG_YES);
|
|
|
+ lcd.setCursor(7, 3);
|
|
|
+ if (!yes) lcd_printPGM(PSTR(">"));
|
|
|
+ lcd.setCursor(8, 3);
|
|
|
+ lcd_printPGM(MSG_NO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
+int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting, bool default_yes)
|
|
|
+{
|
|
|
lcd_display_message_fullscreen_P(msg);
|
|
|
|
|
|
if (default_yes) {
|
|
@@ -1923,6 +2256,7 @@ int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow
|
|
|
// Wait for user confirmation or a timeout.
|
|
|
unsigned long previous_millis_cmd = millis();
|
|
|
int8_t enc_dif = encoderDiff;
|
|
|
+ KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
for (;;) {
|
|
|
if (allow_timeouting && millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS)
|
|
|
return -1;
|
|
@@ -1948,6 +2282,7 @@ int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow
|
|
|
while (lcd_clicked());
|
|
|
delay(10);
|
|
|
while (lcd_clicked());
|
|
|
+ KEEPALIVE_STATE(IN_HANDLER);
|
|
|
return yes;
|
|
|
}
|
|
|
}
|
|
@@ -2158,7 +2493,7 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
|
|
prusa_stat_printerstatus(status_number);
|
|
|
prusa_stat_farm_number();
|
|
|
SERIAL_ECHOLN("}");
|
|
|
- farm_timer = 5;
|
|
|
+ farm_timer = 4;
|
|
|
break;
|
|
|
case 21: // temperatures
|
|
|
SERIAL_ECHO("{");
|
|
@@ -2185,7 +2520,7 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
|
|
SERIAL_ECHOLN("}");
|
|
|
break;
|
|
|
case 92: // Error - Min temp
|
|
|
- SERIAL_ECHOLN("{[ERR:3]");
|
|
|
+ SERIAL_ECHO("{[ERR:3]");
|
|
|
prusa_stat_farm_number();
|
|
|
SERIAL_ECHOLN("}");
|
|
|
break;
|
|
@@ -2610,6 +2945,202 @@ void lcd_toshiba_flash_air_compatibility_toggle()
|
|
|
eeprom_update_byte((uint8_t*)EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY, card.ToshibaFlashAir_isEnabled());
|
|
|
}
|
|
|
|
|
|
+void lcd_v2_calibration() {
|
|
|
+ bool loaded = lcd_show_fullscreen_message_yes_no_and_wait_P(MSG_PLA_FILAMENT_LOADED, false, true);
|
|
|
+ if (loaded) {
|
|
|
+ lcd_commands_type = LCD_COMMAND_V2_CAL;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ lcd_display_message_fullscreen_P(MSG_PLEASE_LOAD_PLA);
|
|
|
+ for (int i = 0; i < 20; i++) { //wait max. 2s
|
|
|
+ delay_keep_alive(100);
|
|
|
+ if (lcd_clicked()) {
|
|
|
+ while (lcd_clicked());
|
|
|
+ delay(10);
|
|
|
+ while (lcd_clicked());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ lcd_return_to_status();
|
|
|
+ lcd_update_enable(true);
|
|
|
+}
|
|
|
+
|
|
|
+void lcd_wizard() {
|
|
|
+ bool result = true;
|
|
|
+ if(calibration_status() != CALIBRATION_STATUS_ASSEMBLED){
|
|
|
+ result = lcd_show_multiscreen_message_yes_no_and_wait_P(MSG_WIZARD_RERUN, true ,false);
|
|
|
+ }
|
|
|
+ if (result) {
|
|
|
+ calibration_status_store(CALIBRATION_STATUS_ASSEMBLED);
|
|
|
+ lcd_wizard(0);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ lcd_update_enable(true);
|
|
|
+ lcd_update(2);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void lcd_wizard(int state) {
|
|
|
+
|
|
|
+ bool end = false;
|
|
|
+ int wizard_event;
|
|
|
+ const char *msg = NULL;
|
|
|
+ while (!end) {
|
|
|
+ switch (state) {
|
|
|
+ case 0: // run wizard?
|
|
|
+ wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(MSG_WIZARD_WELCOME, false, true);
|
|
|
+ if (wizard_event) {
|
|
|
+ state = 1;
|
|
|
+ eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0);
|
|
|
+ end = true;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 1: // restore calibration status
|
|
|
+ switch (calibration_status()) {
|
|
|
+ case CALIBRATION_STATUS_ASSEMBLED: state = 2; break; //run selftest
|
|
|
+ case CALIBRATION_STATUS_XYZ_CALIBRATION: state = 3; break; //run xyz cal.
|
|
|
+ case CALIBRATION_STATUS_Z_CALIBRATION: state = 4; break; //run z cal.
|
|
|
+ case CALIBRATION_STATUS_LIVE_ADJUST: state = 5; break; //run live adjust
|
|
|
+ case CALIBRATION_STATUS_CALIBRATED: end = true; eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0); break;
|
|
|
+ default: state = 2; break; //if calibration status is unknown, run wizard from the beginning
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 2: //selftest
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(MSG_WIZARD_SELFTEST);
|
|
|
+ wizard_event = lcd_selftest();
|
|
|
+ if (wizard_event) {
|
|
|
+ calibration_status_store(CALIBRATION_STATUS_XYZ_CALIBRATION);
|
|
|
+ state = 3;
|
|
|
+ }
|
|
|
+ else end = true;
|
|
|
+ break;
|
|
|
+ case 3: //xyz cal.
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(MSG_WIZARD_XYZ_CAL);
|
|
|
+ wizard_event = gcode_M45(false);
|
|
|
+ if (wizard_event) state = 5;
|
|
|
+ else end = true;
|
|
|
+ break;
|
|
|
+ case 4: //z cal.
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(MSG_WIZARD_Z_CAL);
|
|
|
+ wizard_event = gcode_M45(true);
|
|
|
+ if (wizard_event) state = 11; //shipped, no need to set first layer, go to final message directly
|
|
|
+ else end = true;
|
|
|
+ break;
|
|
|
+ case 5: //is filament loaded?
|
|
|
+ //start to preheat nozzle and bed to save some time later
|
|
|
+ setTargetHotend(PLA_PREHEAT_HOTEND_TEMP, 0);
|
|
|
+ setTargetBed(PLA_PREHEAT_HPB_TEMP);
|
|
|
+ wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(MSG_WIZARD_FILAMENT_LOADED, false);
|
|
|
+ if (wizard_event) state = 8;
|
|
|
+ else state = 6;
|
|
|
+ break;
|
|
|
+ case 6: //waiting for preheat nozzle for PLA;
|
|
|
+ lcd_display_message_fullscreen_P(MSG_WIZARD_WILL_PREHEAT);
|
|
|
+ current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament
|
|
|
+ plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[Z_AXIS] / 60, active_extruder);
|
|
|
+ delay_keep_alive(2000);
|
|
|
+ lcd_display_message_fullscreen_P(MSG_WIZARD_HEATING);
|
|
|
+ while (abs(degHotend(0) - PLA_PREHEAT_HOTEND_TEMP) > 3) {
|
|
|
+ lcd_display_message_fullscreen_P(MSG_WIZARD_HEATING);
|
|
|
+
|
|
|
+ lcd.setCursor(0, 4);
|
|
|
+ lcd.print(LCD_STR_THERMOMETER[0]);
|
|
|
+ lcd.print(ftostr3(degHotend(0)));
|
|
|
+ lcd.print("/");
|
|
|
+ lcd.print(PLA_PREHEAT_HOTEND_TEMP);
|
|
|
+ lcd.print(LCD_STR_DEGREE);
|
|
|
+ lcd_set_custom_characters();
|
|
|
+ delay_keep_alive(1000);
|
|
|
+ }
|
|
|
+ state = 7;
|
|
|
+ break;
|
|
|
+ case 7: //load filament
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(MSG_WIZARD_LOAD_FILAMENT);
|
|
|
+ lcd_implementation_clear();
|
|
|
+ lcd_print_at_PGM(0,2,MSG_LOADING_FILAMENT);
|
|
|
+ loading_flag = true;
|
|
|
+#ifdef SNMM
|
|
|
+ change_extr(0);
|
|
|
+#endif
|
|
|
+ gcode_M701();
|
|
|
+ state = 9;
|
|
|
+ break;
|
|
|
+ case 8:
|
|
|
+ wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(MSG_WIZARD_PLA_FILAMENT, false, true);
|
|
|
+ if (wizard_event) state = 9;
|
|
|
+ else end = true;
|
|
|
+ break;
|
|
|
+ case 9:
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(MSG_WIZARD_V2_CAL);
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(MSG_WIZARD_V2_CAL_2);
|
|
|
+ lcd_commands_type = LCD_COMMAND_V2_CAL;
|
|
|
+ end = true;
|
|
|
+ break;
|
|
|
+ case 10: //repeat first layer cal.?
|
|
|
+ wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(MSG_WIZARD_REPEAT_V2_CAL, false);
|
|
|
+ if (wizard_event) {
|
|
|
+ calibration_status_store(CALIBRATION_STATUS_LIVE_ADJUST);
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(MSG_WIZARD_CLEAN_HEATBED);
|
|
|
+ state = 9;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ state = 11;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 11: //we are finished
|
|
|
+ eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 0);
|
|
|
+ end = true;
|
|
|
+ break;
|
|
|
+
|
|
|
+ default: break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ SERIAL_ECHOPGM("State: ");
|
|
|
+ MYSERIAL.println(state);
|
|
|
+ switch (state) { //final message
|
|
|
+ case 0: //user dont want to use wizard
|
|
|
+ msg = MSG_WIZARD_QUIT;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case 1: //printer was already calibrated
|
|
|
+ msg = MSG_WIZARD_DONE;
|
|
|
+ break;
|
|
|
+ case 2: //selftest
|
|
|
+ msg = MSG_WIZARD_CALIBRATION_FAILED;
|
|
|
+ break;
|
|
|
+ case 3: //xyz cal.
|
|
|
+ msg = MSG_WIZARD_CALIBRATION_FAILED;
|
|
|
+ break;
|
|
|
+ case 4: //z cal.
|
|
|
+ msg = MSG_WIZARD_CALIBRATION_FAILED;
|
|
|
+ break;
|
|
|
+ case 8:
|
|
|
+ msg = MSG_WIZARD_INSERT_CORRECT_FILAMENT;
|
|
|
+ break;
|
|
|
+ case 9: break; //exit wizard for v2 calibration, which is implemted in lcd_commands (we need lcd_update running)
|
|
|
+ case 11: //we are finished
|
|
|
+
|
|
|
+ msg = MSG_WIZARD_DONE;
|
|
|
+ lcd_reset_alert_level();
|
|
|
+ lcd_setstatuspgm(WELCOME_MSG);
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ msg = MSG_WIZARD_QUIT;
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+ if(state != 9) lcd_show_fullscreen_message_and_wait_P(msg);
|
|
|
+ lcd_update_enable(true);
|
|
|
+ lcd_return_to_status();
|
|
|
+ lcd_update(2);
|
|
|
+}
|
|
|
+
|
|
|
static void lcd_settings_menu()
|
|
|
{
|
|
|
EEPROM_read(EEPROM_SILENT, (uint8_t*)&SilentModeMenu, sizeof(SilentModeMenu));
|
|
@@ -2660,6 +3191,7 @@ static void lcd_calibration_menu()
|
|
|
MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
|
|
|
if (!isPrintPaused)
|
|
|
{
|
|
|
+ MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28 W"));
|
|
|
MENU_ITEM(function, MSG_SELFTEST, lcd_selftest);
|
|
|
#ifdef MK1BP
|
|
|
// MK1
|
|
@@ -2667,17 +3199,19 @@ static void lcd_calibration_menu()
|
|
|
MENU_ITEM(gcode, MSG_HOMEYZ, PSTR("G28 Z"));
|
|
|
#else //MK1BP
|
|
|
// MK2
|
|
|
-MENU_ITEM(function, MSG_CALIBRATE_BED, lcd_mesh_calibration);
|
|
|
+ MENU_ITEM(function, MSG_CALIBRATE_BED, lcd_mesh_calibration);
|
|
|
// "Calibrate Z" with storing the reference values to EEPROM.
|
|
|
MENU_ITEM(submenu, MSG_HOMEYZ, lcd_mesh_calibration_z);
|
|
|
+ MENU_ITEM(submenu, MSG_V2_CALIBRATION, lcd_v2_calibration);
|
|
|
|
|
|
#ifndef SNMM
|
|
|
//MENU_ITEM(function, MSG_CALIBRATE_E, lcd_calibrate_extruder);
|
|
|
#endif
|
|
|
// "Mesh Bed Leveling"
|
|
|
MENU_ITEM(submenu, MSG_MESH_BED_LEVELING, lcd_mesh_bedleveling);
|
|
|
+ MENU_ITEM(function, MSG_WIZARD, lcd_wizard);
|
|
|
#endif //MK1BP
|
|
|
- MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28 W"));
|
|
|
+
|
|
|
MENU_ITEM(submenu, MSG_BED_CORRECTION_MENU, lcd_adjust_bed);
|
|
|
#ifndef MK1BP
|
|
|
MENU_ITEM(submenu, MSG_CALIBRATION_PINDA_MENU, lcd_pinda_calibration_menu);
|
|
@@ -3001,7 +3535,7 @@ static char snmm_stop_print_menu() { //menu for choosing which filaments will be
|
|
|
lcd_print_at_PGM(1,3,MSG_CURRENT);
|
|
|
char cursor_pos = 1;
|
|
|
int enc_dif = 0;
|
|
|
-
|
|
|
+ KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
while (1) {
|
|
|
manage_heater();
|
|
|
manage_inactivity(true);
|
|
@@ -3029,10 +3563,10 @@ static char snmm_stop_print_menu() { //menu for choosing which filaments will be
|
|
|
while (lcd_clicked());
|
|
|
delay(10);
|
|
|
while (lcd_clicked());
|
|
|
+ KEEPALIVE_STATE(IN_HANDLER);
|
|
|
return(cursor_pos - 1);
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
char choose_extruder_menu() {
|
|
@@ -3051,7 +3585,7 @@ char choose_extruder_menu() {
|
|
|
for (int i = 0; i < 3; i++) {
|
|
|
lcd_print_at_PGM(1, i + 1, MSG_EXTRUDER);
|
|
|
}
|
|
|
-
|
|
|
+ KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
while (1) {
|
|
|
|
|
|
for (int i = 0; i < 3; i++) {
|
|
@@ -3115,6 +3649,7 @@ char choose_extruder_menu() {
|
|
|
while (lcd_clicked());
|
|
|
delay(10);
|
|
|
while (lcd_clicked());
|
|
|
+ KEEPALIVE_STATE(IN_HANDLER);
|
|
|
return(cursor_pos + first - 1);
|
|
|
|
|
|
}
|
|
@@ -3320,7 +3855,7 @@ void display_loading() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static void extr_adj(int extruder) //loading filament for SNMM
|
|
|
+void extr_adj(int extruder) //loading filament for SNMM
|
|
|
{
|
|
|
bool correct;
|
|
|
max_feedrate[E_AXIS] =80;
|
|
@@ -3334,13 +3869,13 @@ static void extr_adj(int extruder) //loading filament for SNMM
|
|
|
case 3: lcd_display_message_fullscreen_P(MSG_FILAMENT_LOADING_T3); break;
|
|
|
default: lcd_display_message_fullscreen_P(MSG_FILAMENT_LOADING_T0); break;
|
|
|
}
|
|
|
-
|
|
|
+ KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
do{
|
|
|
extr_mov(0.001,1000);
|
|
|
delay_keep_alive(2);
|
|
|
} while (!lcd_clicked());
|
|
|
//delay_keep_alive(500);
|
|
|
-
|
|
|
+ KEEPALIVE_STATE(IN_HANDLER);
|
|
|
st_synchronize();
|
|
|
//correct = lcd_show_fullscreen_message_yes_no_and_wait_P(MSG_FIL_LOADED_CHECK, false);
|
|
|
//if (!correct) goto START;
|
|
@@ -3656,8 +4191,8 @@ unsigned char lcd_choose_color() {
|
|
|
//-----------------------------------------------------
|
|
|
unsigned char items_no = 2;
|
|
|
const char *item[items_no];
|
|
|
- item[0] = "Black";
|
|
|
- item[1] = "Orange";
|
|
|
+ item[0] = "Orange";
|
|
|
+ item[1] = "Black";
|
|
|
//-----------------------------------------------------
|
|
|
unsigned char active_rows;
|
|
|
static int first = 0;
|
|
@@ -3679,10 +4214,9 @@ unsigned char lcd_choose_color() {
|
|
|
|
|
|
manage_heater();
|
|
|
manage_inactivity(true);
|
|
|
-
|
|
|
- if (abs((enc_dif - encoderDiff)) > 4) {
|
|
|
-
|
|
|
- if ((abs(enc_dif - encoderDiff)) > 1) {
|
|
|
+ proc_commands();
|
|
|
+ if (abs((enc_dif - encoderDiff)) > 12) {
|
|
|
+
|
|
|
if (enc_dif > encoderDiff) {
|
|
|
cursor_pos--;
|
|
|
}
|
|
@@ -3690,7 +4224,7 @@ unsigned char lcd_choose_color() {
|
|
|
if (enc_dif < encoderDiff) {
|
|
|
cursor_pos++;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (cursor_pos > active_rows) {
|
|
|
cursor_pos = active_rows;
|
|
|
if (first < items_no - active_rows) {
|
|
@@ -3716,7 +4250,6 @@ unsigned char lcd_choose_color() {
|
|
|
lcd.print(">");
|
|
|
enc_dif = encoderDiff;
|
|
|
delay(100);
|
|
|
- }
|
|
|
|
|
|
}
|
|
|
|
|
@@ -3724,7 +4257,11 @@ unsigned char lcd_choose_color() {
|
|
|
while (lcd_clicked());
|
|
|
delay(10);
|
|
|
while (lcd_clicked());
|
|
|
- return(cursor_pos + first - 1);
|
|
|
+ switch(cursor_pos + first - 1) {
|
|
|
+ case 0: return 1; break;
|
|
|
+ case 1: return 0; break;
|
|
|
+ default: return 99; break;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -3739,7 +4276,7 @@ void lcd_confirm_print()
|
|
|
int _ret = 0;
|
|
|
int _t = 0;
|
|
|
|
|
|
-
|
|
|
+ enc_dif = encoderDiff;
|
|
|
lcd_implementation_clear();
|
|
|
|
|
|
lcd.setCursor(0, 0);
|
|
@@ -3747,8 +4284,7 @@ void lcd_confirm_print()
|
|
|
|
|
|
do
|
|
|
{
|
|
|
-
|
|
|
- if (abs((enc_dif - encoderDiff)) > 2) {
|
|
|
+ if (abs(enc_dif - encoderDiff) > 12) {
|
|
|
if (enc_dif > encoderDiff) {
|
|
|
cursor_pos--;
|
|
|
}
|
|
@@ -3756,6 +4292,7 @@ void lcd_confirm_print()
|
|
|
if (enc_dif < encoderDiff) {
|
|
|
cursor_pos++;
|
|
|
}
|
|
|
+ enc_dif = encoderDiff;
|
|
|
}
|
|
|
|
|
|
if (cursor_pos > 2) { cursor_pos = 2; }
|
|
@@ -3800,9 +4337,10 @@ void lcd_confirm_print()
|
|
|
NcTime = millis();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
manage_heater();
|
|
|
manage_inactivity();
|
|
|
+ proc_commands();
|
|
|
|
|
|
} while (_ret == 0);
|
|
|
|
|
@@ -4351,7 +4889,7 @@ menu_edit_type(float, float51, ftostr51, 10)
|
|
|
menu_edit_type(float, float52, ftostr52, 100)
|
|
|
menu_edit_type(unsigned long, long5, ftostr5, 0.01)
|
|
|
|
|
|
-static void lcd_selftest()
|
|
|
+static bool lcd_selftest()
|
|
|
{
|
|
|
int _progress = 0;
|
|
|
bool _result = false;
|
|
@@ -4414,8 +4952,10 @@ static void lcd_selftest()
|
|
|
current_position[Y_AXIS] = current_position[Y_AXIS] - 14;
|
|
|
_progress = lcd_selftest_screen(4, _progress, 3, true, 1500);
|
|
|
_result = lcd_selfcheck_axis(2, Z_MAX_POS);
|
|
|
- enquecommand_P(PSTR("G28 W"));
|
|
|
- enquecommand_P(PSTR("G1 Z15"));
|
|
|
+ if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) != 1) {
|
|
|
+ enquecommand_P(PSTR("G28 W"));
|
|
|
+ enquecommand_P(PSTR("G1 Z15"));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (_result)
|
|
@@ -4438,12 +4978,13 @@ static void lcd_selftest()
|
|
|
|
|
|
if (_result)
|
|
|
{
|
|
|
- LCD_ALERTMESSAGERPGM(MSG_SELFTEST_OK);
|
|
|
+ LCD_ALERTMESSAGERPGM(MSG_SELFTEST_OK);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
LCD_ALERTMESSAGERPGM(MSG_SELFTEST_FAILED);
|
|
|
}
|
|
|
+ return(_result);
|
|
|
}
|
|
|
|
|
|
static bool lcd_selfcheck_axis(int _axis, int _travel)
|
|
@@ -4822,6 +5363,7 @@ static bool lcd_selftest_fan_dialog(int _fan)
|
|
|
lcd.setCursor(1, 3); lcd_printPGM(MSG_SELFTEST_FAN_NO);
|
|
|
|
|
|
int8_t enc_dif = 0;
|
|
|
+ KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
do
|
|
|
{
|
|
|
switch (_fan)
|
|
@@ -4862,7 +5404,7 @@ static bool lcd_selftest_fan_dialog(int _fan)
|
|
|
delay(100);
|
|
|
|
|
|
} while (!lcd_clicked());
|
|
|
-
|
|
|
+ KEEPALIVE_STATE(IN_HANDLER);
|
|
|
SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN);
|
|
|
WRITE(EXTRUDER_0_AUTO_FAN_PIN, 0);
|
|
|
SET_OUTPUT(FAN_PIN);
|
|
@@ -4981,16 +5523,43 @@ static void menu_action_setlang(unsigned char lang) {
|
|
|
static void menu_action_function(menuFunc_t data) {
|
|
|
(*data)();
|
|
|
}
|
|
|
+
|
|
|
+static bool check_file(const char* filename) {
|
|
|
+ bool result = false;
|
|
|
+ uint32_t filesize;
|
|
|
+ card.openFile(filename, true);
|
|
|
+ filesize = card.getFileSize();
|
|
|
+ if (filesize > END_FILE_SECTION) {
|
|
|
+ card.setIndex(filesize - END_FILE_SECTION);
|
|
|
+ }
|
|
|
+
|
|
|
+ while (!card.eof() && !result) {
|
|
|
+ card.sdprinting = true;
|
|
|
+ get_command();
|
|
|
+ result = check_commands();
|
|
|
+ }
|
|
|
+ card.printingHasFinished();
|
|
|
+ strncpy_P(lcd_status_message, WELCOME_MSG, LCD_WIDTH);
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
static void menu_action_sdfile(const char* filename, char* longFilename)
|
|
|
-{
|
|
|
+{
|
|
|
loading_flag = false;
|
|
|
char cmd[30];
|
|
|
char* c;
|
|
|
+ bool result = true;
|
|
|
sprintf_P(cmd, PSTR("M23 %s"), filename);
|
|
|
for (c = &cmd[4]; *c; c++)
|
|
|
- *c = tolower(*c);
|
|
|
- enquecommand(cmd);
|
|
|
- enquecommand_P(PSTR("M24"));
|
|
|
+ *c = tolower(*c);
|
|
|
+ if (!check_file(filename)) {
|
|
|
+ result = lcd_show_fullscreen_message_yes_no_and_wait_P(MSG_FILE_INCOMPLETE, false, false);
|
|
|
+ lcd_update_enable(true);
|
|
|
+ }
|
|
|
+ if (result) {
|
|
|
+ enquecommand(cmd);
|
|
|
+ enquecommand_P(PSTR("M24"));
|
|
|
+ }
|
|
|
lcd_return_to_status();
|
|
|
}
|
|
|
static void menu_action_sddirectory(const char* filename, char* longFilename)
|
|
@@ -5225,6 +5794,7 @@ void lcd_update(uint8_t lcdDrawUpdateOverride)
|
|
|
if (!SdFatUtil::test_stack_integrity()) stack_error();
|
|
|
lcd_ping(); //check that we have received ping command if we are in farm mode
|
|
|
lcd_send_status();
|
|
|
+ if (lcd_commands_type == LCD_COMMAND_V2_CAL) lcd_commands();
|
|
|
}
|
|
|
|
|
|
void lcd_printer_connected() {
|