|
@@ -481,21 +481,35 @@ uint16_t max_display_update_time = 0;
|
481
|
481
|
/**
|
482
|
482
|
* Show "Moving..." till moves are done, then revert to previous display.
|
483
|
483
|
*/
|
484
|
|
- inline void lcd_synchronize(const char * const msg=NULL) {
|
|
484
|
+ static const char moving[] PROGMEM = MSG_MOVING;
|
|
485
|
+ static const char *sync_message = moving;
|
|
486
|
+
|
|
487
|
+ //
|
|
488
|
+ // Display the synchronize screen until moves are
|
|
489
|
+ // finished, and don't return to the caller until
|
|
490
|
+ // done. ** This blocks the command queue! **
|
|
491
|
+ //
|
|
492
|
+ void _lcd_synchronize() {
|
485
|
493
|
static bool no_reentry = false;
|
486
|
|
- const static char moving[] PROGMEM = MSG_MOVING;
|
487
|
|
- lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, msg ? msg : moving);
|
|
494
|
+ if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, sync_message);
|
488
|
495
|
if (no_reentry) return;
|
489
|
496
|
|
490
|
497
|
// Make this the current handler till all moves are done
|
491
|
498
|
no_reentry = true;
|
492
|
499
|
screenFunc_t old_screen = currentScreen;
|
493
|
|
- lcd_goto_screen(lcd_synchronize);
|
|
500
|
+ lcd_goto_screen(_lcd_synchronize);
|
494
|
501
|
stepper.synchronize();
|
495
|
502
|
no_reentry = false;
|
496
|
503
|
lcd_goto_screen(old_screen);
|
497
|
504
|
}
|
498
|
505
|
|
|
506
|
+ // Display the synchronize screen with a custom message
|
|
507
|
+ // ** This blocks the command queue! **
|
|
508
|
+ void lcd_synchronize(const char * const msg=NULL) {
|
|
509
|
+ sync_message = msg ? msg : moving;
|
|
510
|
+ _lcd_synchronize();
|
|
511
|
+ }
|
|
512
|
+
|
499
|
513
|
void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); }
|
500
|
514
|
|
501
|
515
|
void lcd_save_previous_screen() {
|
|
@@ -680,7 +694,7 @@ void kill_screen(const char* lcd_msg) {
|
680
|
694
|
#if ENABLED(PARK_HEAD_ON_PAUSE)
|
681
|
695
|
enqueue_and_echo_commands_P(PSTR("M125"));
|
682
|
696
|
#endif
|
683
|
|
- lcd_setstatuspgm(PSTR(MSG_PRINT_PAUSED), true);
|
|
697
|
+ lcd_setstatusPGM(PSTR(MSG_PRINT_PAUSED), -1);
|
684
|
698
|
}
|
685
|
699
|
|
686
|
700
|
void lcd_sdcard_resume() {
|
|
@@ -690,7 +704,7 @@ void kill_screen(const char* lcd_msg) {
|
690
|
704
|
card.startFileprint();
|
691
|
705
|
print_job_timer.start();
|
692
|
706
|
#endif
|
693
|
|
- lcd_setstatuspgm(PSTR(""), true);
|
|
707
|
+ lcd_setstatusPGM(PSTR(""), -1);
|
694
|
708
|
}
|
695
|
709
|
|
696
|
710
|
void lcd_sdcard_stop() {
|
|
@@ -703,7 +717,7 @@ void kill_screen(const char* lcd_msg) {
|
703
|
717
|
for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0;
|
704
|
718
|
#endif
|
705
|
719
|
wait_for_heatup = false;
|
706
|
|
- LCD_MESSAGEPGM(MSG_PRINT_ABORTED);
|
|
720
|
+ lcd_setstatusPGM(PSTR(MSG_PRINT_PAUSED), -1);
|
707
|
721
|
}
|
708
|
722
|
|
709
|
723
|
#endif // SDSUPPORT
|
|
@@ -1420,6 +1434,26 @@ void kill_screen(const char* lcd_msg) {
|
1420
|
1434
|
#endif
|
1421
|
1435
|
);
|
1422
|
1436
|
|
|
1437
|
+ //
|
|
1438
|
+ // Raise Z to the "manual probe height"
|
|
1439
|
+ // Don't return until done.
|
|
1440
|
+ // ** This blocks the command queue! **
|
|
1441
|
+ //
|
|
1442
|
+ void _lcd_after_probing() {
|
|
1443
|
+ #if MANUAL_PROBE_HEIGHT > 0
|
|
1444
|
+ current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT;
|
|
1445
|
+ line_to_current(Z_AXIS);
|
|
1446
|
+ #endif
|
|
1447
|
+ // Display "Done" screen and wait for moves to complete
|
|
1448
|
+ #if MANUAL_PROBE_HEIGHT > 0 || ENABLED(MESH_BED_LEVELING)
|
|
1449
|
+ lcd_synchronize(PSTR(MSG_LEVEL_BED_DONE));
|
|
1450
|
+ #endif
|
|
1451
|
+ lcd_goto_previous_menu();
|
|
1452
|
+ lcd_completion_feedback();
|
|
1453
|
+ defer_return_to_status = false;
|
|
1454
|
+ //LCD_MESSAGEPGM(MSG_LEVEL_BED_DONE);
|
|
1455
|
+ }
|
|
1456
|
+
|
1423
|
1457
|
#if ENABLED(MESH_BED_LEVELING)
|
1424
|
1458
|
|
1425
|
1459
|
// Utility to go to the next mesh point
|
|
@@ -1432,18 +1466,28 @@ void kill_screen(const char* lcd_msg) {
|
1432
|
1466
|
current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
|
1433
|
1467
|
planner.buffer_line_kinematic(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder);
|
1434
|
1468
|
#if MANUAL_PROBE_HEIGHT > 0
|
1435
|
|
- current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + 0.2;
|
|
1469
|
+ current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS);
|
1436
|
1470
|
line_to_current(Z_AXIS);
|
1437
|
1471
|
#endif
|
1438
|
1472
|
lcd_synchronize();
|
1439
|
1473
|
}
|
1440
|
1474
|
|
1441
|
|
- #endif // MESH_BED_LEVELING
|
|
1475
|
+ #elif ENABLED(PROBE_MANUALLY)
|
1442
|
1476
|
|
1443
|
|
- void _lcd_level_bed_done() {
|
1444
|
|
- if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_DONE));
|
1445
|
|
- lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
|
1446
|
|
- }
|
|
1477
|
+ bool lcd_wait_for_move;
|
|
1478
|
+
|
|
1479
|
+ //
|
|
1480
|
+ // Bed leveling is done. Wait for G29 to complete.
|
|
1481
|
+ // A flag is used so that this can release control
|
|
1482
|
+ // and allow the command queue to be processed.
|
|
1483
|
+ //
|
|
1484
|
+ void _lcd_level_bed_done() {
|
|
1485
|
+ if (!lcd_wait_for_move) _lcd_after_probing();
|
|
1486
|
+ if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_DONE));
|
|
1487
|
+ lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
|
|
1488
|
+ }
|
|
1489
|
+
|
|
1490
|
+ #endif
|
1447
|
1491
|
|
1448
|
1492
|
void _lcd_level_goto_next_point();
|
1449
|
1493
|
|
|
@@ -1455,59 +1499,55 @@ void kill_screen(const char* lcd_msg) {
|
1455
|
1499
|
|
1456
|
1500
|
if (lcd_clicked) {
|
1457
|
1501
|
|
1458
|
|
- // Use a hook to set the probe point z
|
|
1502
|
+ //
|
|
1503
|
+ // Save the current Z position
|
|
1504
|
+ //
|
|
1505
|
+
|
1459
|
1506
|
#if ENABLED(MESH_BED_LEVELING)
|
1460
|
1507
|
|
|
1508
|
+ //
|
1461
|
1509
|
// MBL records the position but doesn't move to the next one
|
1462
|
|
- mbl.set_zigzag_z(manual_probe_index, current_position[Z_AXIS]);
|
|
1510
|
+ //
|
1463
|
1511
|
|
1464
|
|
- #elif ENABLED(PROBE_MANUALLY)
|
1465
|
|
-
|
1466
|
|
- // The last G29 will record but not move
|
1467
|
|
- if (manual_probe_index == total_probe_points - 1)
|
1468
|
|
- enqueue_and_echo_commands_P(PSTR("G29 V1"));
|
|
1512
|
+ mbl.set_zigzag_z(manual_probe_index, current_position[Z_AXIS]);
|
1469
|
1513
|
|
1470
|
1514
|
#endif
|
1471
|
1515
|
|
1472
|
1516
|
// If done...
|
1473
|
1517
|
if (++manual_probe_index >= total_probe_points) {
|
1474
|
1518
|
|
1475
|
|
- // Say "Done!"
|
1476
|
|
- lcd_goto_screen(_lcd_level_bed_done);
|
|
1519
|
+ #if ENABLED(PROBE_MANUALLY)
|
1477
|
1520
|
|
1478
|
|
- // Raise Z to the "manual probe height"
|
1479
|
|
- #if MANUAL_PROBE_HEIGHT > 0
|
1480
|
|
- current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT;
|
1481
|
|
- line_to_current(Z_AXIS);
|
1482
|
|
- #endif
|
|
1521
|
+ //
|
|
1522
|
+ // The last G29 will record and enable but not move.
|
|
1523
|
+ // Since G29 is deferred,
|
|
1524
|
+ //
|
|
1525
|
+ lcd_wait_for_move = true;
|
|
1526
|
+ enqueue_and_echo_commands_P(PSTR("G29 V1"));
|
|
1527
|
+ lcd_goto_screen(_lcd_level_bed_done);
|
1483
|
1528
|
|
1484
|
|
- #if MANUAL_PROBE_HEIGHT > 0 || ENABLED(MESH_BED_LEVELING)
|
1485
|
|
- lcd_synchronize(PSTR(MSG_LEVEL_BED_DONE));
|
1486
|
|
- #endif
|
|
1529
|
+ #elif ENABLED(MESH_BED_LEVELING)
|
1487
|
1530
|
|
1488
|
|
- // Enable leveling, if needed
|
1489
|
|
- #if ENABLED(MESH_BED_LEVELING)
|
|
1531
|
+ _lcd_after_probing();
|
1490
|
1532
|
|
1491
|
1533
|
mbl.set_has_mesh(true);
|
1492
|
1534
|
mesh_probing_done();
|
1493
|
1535
|
|
1494
|
|
- #elif ENABLED(PROBE_MANUALLY)
|
1495
|
|
-
|
1496
|
|
- // ABL will be enabled due to "G29".
|
1497
|
|
-
|
1498
|
1536
|
#endif
|
1499
|
1537
|
|
1500
|
|
- lcd_return_to_status();
|
1501
|
|
- //LCD_MESSAGEPGM(MSG_LEVEL_BED_DONE);
|
1502
|
|
- lcd_completion_feedback();
|
1503
|
1538
|
}
|
1504
|
|
- else
|
|
1539
|
+ else {
|
|
1540
|
+ // MESH_BED_LEVELING: Z already stored, just move
|
|
1541
|
+ // PROBE_MANUALLY: Send G29 to record Z, then move
|
1505
|
1542
|
_lcd_level_goto_next_point();
|
|
1543
|
+ }
|
1506
|
1544
|
|
1507
|
1545
|
return;
|
1508
|
1546
|
}
|
1509
|
1547
|
|
|
1548
|
+ //
|
1510
|
1549
|
// Encoder knob or keypad buttons adjust the Z position
|
|
1550
|
+ //
|
1511
|
1551
|
if (encoderPosition) {
|
1512
|
1552
|
refresh_cmd_timeout();
|
1513
|
1553
|
current_position[Z_AXIS] += float((int32_t)encoderPosition) * (MBL_Z_STEP);
|
|
@@ -1518,8 +1558,9 @@ void kill_screen(const char* lcd_msg) {
|
1518
|
1558
|
encoderPosition = 0;
|
1519
|
1559
|
}
|
1520
|
1560
|
|
1521
|
|
- // Update on first display, then only on updates to Z position
|
1522
|
|
- // Show message above on clicks instead
|
|
1561
|
+ //
|
|
1562
|
+ // Draw on first display, then only on Z change
|
|
1563
|
+ //
|
1523
|
1564
|
if (lcdDrawUpdate) {
|
1524
|
1565
|
const float v = current_position[Z_AXIS];
|
1525
|
1566
|
lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001 : 0.0001), '+'));
|
|
@@ -1530,10 +1571,6 @@ void kill_screen(const char* lcd_msg) {
|
1530
|
1571
|
* Step 6: Display "Next point: 1 / 9" while waiting for move to finish
|
1531
|
1572
|
*/
|
1532
|
1573
|
|
1533
|
|
- #if ENABLED(PROBE_MANUALLY)
|
1534
|
|
- bool lcd_wait_for_move;
|
1535
|
|
- #endif
|
1536
|
|
-
|
1537
|
1574
|
void _lcd_level_bed_moving() {
|
1538
|
1575
|
if (lcdDrawUpdate) {
|
1539
|
1576
|
char msg[10];
|
|
@@ -1570,7 +1607,7 @@ void kill_screen(const char* lcd_msg) {
|
1570
|
1607
|
|
1571
|
1608
|
#elif ENABLED(PROBE_MANUALLY)
|
1572
|
1609
|
|
1573
|
|
- // G29 will signal when it's done
|
|
1610
|
+ // G29 Records Z, moves, and signals when it pauses
|
1574
|
1611
|
lcd_wait_for_move = true;
|
1575
|
1612
|
enqueue_and_echo_commands_P(PSTR("G29 V1"));
|
1576
|
1613
|
|
|
@@ -1620,19 +1657,22 @@ void kill_screen(const char* lcd_msg) {
|
1620
|
1657
|
/**
|
1621
|
1658
|
* Step 1: Bed Level entry-point
|
1622
|
1659
|
* - Cancel
|
|
1660
|
+ * - Auto Home (if homing needed)
|
|
1661
|
+ * - Leveling On/Off (if data exists, and homed)
|
1623
|
1662
|
* - Level Bed >
|
1624
|
|
- * - Leveling On/Off (if there is leveling data)
|
1625
|
|
- * - Fade Height (Req: ENABLE_LEVELING_FADE_HEIGHT)
|
1626
|
|
- * - Mesh Z Offset (Req: MESH_BED_LEVELING)
|
1627
|
|
- * - Z Probe Offset (Req: HAS_BED_PROBE, Opt: BABYSTEP_ZPROBE_OFFSET)
|
1628
|
|
- * - Load Settings (Req: EEPROM_SETTINGS)
|
1629
|
|
- * - Save Settings (Req: EEPROM_SETTINGS)
|
|
1663
|
+ * - Fade Height (Req: ENABLE_LEVELING_FADE_HEIGHT)
|
|
1664
|
+ * - Mesh Z Offset (Req: MESH_BED_LEVELING)
|
|
1665
|
+ * - Z Probe Offset (Req: HAS_BED_PROBE, Opt: BABYSTEP_ZPROBE_OFFSET)
|
|
1666
|
+ * - Load Settings (Req: EEPROM_SETTINGS)
|
|
1667
|
+ * - Save Settings (Req: EEPROM_SETTINGS)
|
1630
|
1668
|
*/
|
1631
|
|
- void lcd_level_bed() {
|
|
1669
|
+ void lcd_bed_leveling() {
|
1632
|
1670
|
START_MENU();
|
1633
|
1671
|
MENU_BACK(MSG_PREPARE);
|
1634
|
|
- MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
|
1635
|
|
- if (leveling_is_valid()) { // Leveling data exists? Show more options.
|
|
1672
|
+
|
|
1673
|
+ if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]))
|
|
1674
|
+ MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
|
|
1675
|
+ else if (leveling_is_valid()) {
|
1636
|
1676
|
_level_state = leveling_is_active();
|
1637
|
1677
|
MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &_level_state, _lcd_toggle_bed_leveling);
|
1638
|
1678
|
}
|
|
@@ -1642,7 +1682,9 @@ void kill_screen(const char* lcd_msg) {
|
1642
|
1682
|
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_Z_FADE_HEIGHT, &planner.z_fade_height, 0.0, 100.0, _lcd_set_z_fade_height);
|
1643
|
1683
|
#endif
|
1644
|
1684
|
|
1645
|
|
- // Manual bed leveling, Bed Z:
|
|
1685
|
+ //
|
|
1686
|
+ // MBL Z Offset
|
|
1687
|
+ //
|
1646
|
1688
|
#if ENABLED(MESH_BED_LEVELING)
|
1647
|
1689
|
MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1);
|
1648
|
1690
|
#endif
|
|
@@ -1653,6 +1695,8 @@ void kill_screen(const char* lcd_msg) {
|
1653
|
1695
|
MENU_ITEM_EDIT_CALLBACK(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, lcd_refresh_zprobe_zoffset);
|
1654
|
1696
|
#endif
|
1655
|
1697
|
|
|
1698
|
+ MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
|
|
1699
|
+
|
1656
|
1700
|
#if ENABLED(EEPROM_SETTINGS)
|
1657
|
1701
|
MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings);
|
1658
|
1702
|
MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings);
|
|
@@ -2063,7 +2107,7 @@ void kill_screen(const char* lcd_msg) {
|
2063
|
2107
|
#if ENABLED(PROBE_MANUALLY)
|
2064
|
2108
|
if (!g29_in_progress)
|
2065
|
2109
|
#endif
|
2066
|
|
- MENU_ITEM(submenu, MSG_BED_LEVELING, lcd_level_bed);
|
|
2110
|
+ MENU_ITEM(submenu, MSG_BED_LEVELING, lcd_bed_leveling);
|
2067
|
2111
|
#endif
|
2068
|
2112
|
|
2069
|
2113
|
#if HAS_M206_COMMAND
|
|
@@ -2826,8 +2870,8 @@ void kill_screen(const char* lcd_msg) {
|
2826
|
2870
|
static void lcd_refresh_zprobe_zoffset() { refresh_zprobe_zoffset(); }
|
2827
|
2871
|
#endif
|
2828
|
2872
|
|
2829
|
|
- // M203 / M205 Feedrates
|
2830
|
|
- void lcd_control_motion_feedrate_menu() {
|
|
2873
|
+ // M203 / M205 Velocity options
|
|
2874
|
+ void lcd_control_motion_velocity_menu() {
|
2831
|
2875
|
START_MENU();
|
2832
|
2876
|
MENU_BACK(MSG_MOTION);
|
2833
|
2877
|
|
|
@@ -2957,18 +3001,19 @@ void kill_screen(const char* lcd_msg) {
|
2957
|
3001
|
MENU_ITEM_EDIT_CALLBACK(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, lcd_refresh_zprobe_zoffset);
|
2958
|
3002
|
#endif
|
2959
|
3003
|
|
2960
|
|
- // M203 / M205 Feedrate items
|
2961
|
|
- MENU_ITEM(submenu, MSG_FEEDRATE, lcd_control_motion_feedrate_menu);
|
|
3004
|
+ // M203 / M205 - Feedrate items
|
|
3005
|
+ MENU_ITEM(submenu, MSG_VELOCITY, lcd_control_motion_velocity_menu);
|
2962
|
3006
|
|
2963
|
|
- // M201 Acceleration items
|
|
3007
|
+ // M201 - Acceleration items
|
2964
|
3008
|
MENU_ITEM(submenu, MSG_ACCELERATION, lcd_control_motion_acceleration_menu);
|
2965
|
3009
|
|
2966
|
|
- // M205 Max Jerk
|
|
3010
|
+ // M205 - Max Jerk
|
2967
|
3011
|
MENU_ITEM(submenu, MSG_JERK, lcd_control_motion_jerk_menu);
|
2968
|
3012
|
|
2969
|
|
- // M92 Steps Per mm
|
|
3013
|
+ // M92 - Steps Per mm
|
2970
|
3014
|
MENU_ITEM(submenu, MSG_STEPS_PER_MM, lcd_control_motion_steps_per_mm_menu);
|
2971
|
3015
|
|
|
3016
|
+ // M540 S - Abort on endstop hit when SD printing
|
2972
|
3017
|
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
|
2973
|
3018
|
MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &stepper.abort_on_endstop_hit);
|
2974
|
3019
|
#endif
|
|
@@ -4095,7 +4140,8 @@ void lcd_setstatus(const char * const message, const bool persist) {
|
4095
|
4140
|
lcd_finishstatus(persist);
|
4096
|
4141
|
}
|
4097
|
4142
|
|
4098
|
|
-void lcd_setstatuspgm(const char * const message, const uint8_t level) {
|
|
4143
|
+void lcd_setstatusPGM(const char * const message, int8_t level) {
|
|
4144
|
+ if (level < 0) level = lcd_status_message_level = 0;
|
4099
|
4145
|
if (level < lcd_status_message_level) return;
|
4100
|
4146
|
lcd_status_message_level = level;
|
4101
|
4147
|
strncpy_P(lcd_status_message, message, 3 * (LCD_WIDTH));
|
|
@@ -4113,7 +4159,7 @@ void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) {
|
4113
|
4159
|
}
|
4114
|
4160
|
|
4115
|
4161
|
void lcd_setalertstatuspgm(const char * const message) {
|
4116
|
|
- lcd_setstatuspgm(message, 1);
|
|
4162
|
+ lcd_setstatusPGM(message, 1);
|
4117
|
4163
|
#if ENABLED(ULTIPANEL)
|
4118
|
4164
|
lcd_return_to_status();
|
4119
|
4165
|
#endif
|