|
@@ -155,6 +155,8 @@ uint16_t max_display_update_time = 0;
|
155
|
155
|
extern bool powersupply_on;
|
156
|
156
|
#endif
|
157
|
157
|
|
|
158
|
+ float move_menu_scale;
|
|
159
|
+
|
158
|
160
|
////////////////////////////////////////////
|
159
|
161
|
///////////////// Menu Tree ////////////////
|
160
|
162
|
////////////////////////////////////////////
|
|
@@ -2679,28 +2681,9 @@ void kill_screen(const char* lcd_msg) {
|
2679
|
2681
|
END_MENU();
|
2680
|
2682
|
}
|
2681
|
2683
|
|
2682
|
|
- float move_menu_scale;
|
2683
|
|
-
|
2684
|
|
- #if ENABLED(DELTA_CALIBRATION_MENU)
|
|
2684
|
+ #if ENABLED(DELTA_CALIBRATION_MENU) || (ENABLED(DELTA_AUTO_CALIBRATION) && !HAS_BED_PROBE)
|
2685
|
2685
|
|
2686
|
2686
|
void lcd_move_z();
|
2687
|
|
- void lcd_delta_calibrate_menu();
|
2688
|
|
-
|
2689
|
|
- void _lcd_calibrate_homing() {
|
2690
|
|
- if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_HOMING));
|
2691
|
|
- lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
|
2692
|
|
- if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
|
2693
|
|
- lcd_goto_previous_menu();
|
2694
|
|
- }
|
2695
|
|
-
|
2696
|
|
- void _lcd_delta_calibrate_home() {
|
2697
|
|
- #if HAS_LEVELING
|
2698
|
|
- reset_bed_level(); // After calibration bed-level data is no longer valid
|
2699
|
|
- #endif
|
2700
|
|
-
|
2701
|
|
- enqueue_and_echo_commands_P(PSTR("G28"));
|
2702
|
|
- lcd_goto_screen(_lcd_calibrate_homing);
|
2703
|
|
- }
|
2704
|
2687
|
|
2705
|
2688
|
void _man_probe_pt(const float &rx, const float &ry) {
|
2706
|
2689
|
#if HAS_LEVELING
|
|
@@ -2720,6 +2703,10 @@ void kill_screen(const char* lcd_msg) {
|
2720
|
2703
|
lcd_goto_screen(lcd_move_z);
|
2721
|
2704
|
}
|
2722
|
2705
|
|
|
2706
|
+ #endif // DELTA_CALIBRATION_MENU || (DELTA_AUTO_CALIBRATION && !HAS_BED_PROBE)
|
|
2707
|
+
|
|
2708
|
+ #if ENABLED(DELTA_AUTO_CALIBRATION) && !HAS_BED_PROBE
|
|
2709
|
+
|
2723
|
2710
|
float lcd_probe_pt(const float &rx, const float &ry) {
|
2724
|
2711
|
_man_probe_pt(rx, ry);
|
2725
|
2712
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
@@ -2731,6 +2718,26 @@ void kill_screen(const char* lcd_msg) {
|
2731
|
2718
|
return current_position[Z_AXIS];
|
2732
|
2719
|
}
|
2733
|
2720
|
|
|
2721
|
+ #endif // DELTA_AUTO_CALIBRATION && !HAS_BED_PROBE
|
|
2722
|
+
|
|
2723
|
+ #if ENABLED(DELTA_CALIBRATION_MENU)
|
|
2724
|
+
|
|
2725
|
+ void _lcd_calibrate_homing() {
|
|
2726
|
+ if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_HOMING));
|
|
2727
|
+ lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
|
|
2728
|
+ if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
|
|
2729
|
+ lcd_goto_previous_menu();
|
|
2730
|
+ }
|
|
2731
|
+
|
|
2732
|
+ void _lcd_delta_calibrate_home() {
|
|
2733
|
+ #if HAS_LEVELING
|
|
2734
|
+ reset_bed_level(); // After calibration bed-level data is no longer valid
|
|
2735
|
+ #endif
|
|
2736
|
+
|
|
2737
|
+ enqueue_and_echo_commands_P(PSTR("G28"));
|
|
2738
|
+ lcd_goto_screen(_lcd_calibrate_homing);
|
|
2739
|
+ }
|
|
2740
|
+
|
2734
|
2741
|
void _goto_tower_x() { _man_probe_pt(cos(RADIANS(210)) * delta_calibration_radius, sin(RADIANS(210)) * delta_calibration_radius); }
|
2735
|
2742
|
void _goto_tower_y() { _man_probe_pt(cos(RADIANS(330)) * delta_calibration_radius, sin(RADIANS(330)) * delta_calibration_radius); }
|
2736
|
2743
|
void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); }
|
|
@@ -4729,22 +4736,18 @@ void lcd_update() {
|
4729
|
4736
|
#endif
|
4730
|
4737
|
|
4731
|
4738
|
if ((lcdDrawUpdate || IS_DRAWING) && (!bbr2 || bbr2 > max_display_update_time)) {
|
4732
|
|
- #if ENABLED(DOGLCD)
|
4733
|
|
- if (!drawing_screen)
|
4734
|
|
- #endif
|
4735
|
|
- {
|
4736
|
|
- switch (lcdDrawUpdate) {
|
4737
|
|
- case LCDVIEW_CALL_NO_REDRAW:
|
4738
|
|
- lcdDrawUpdate = LCDVIEW_NONE;
|
4739
|
|
- break;
|
4740
|
|
- case LCDVIEW_CLEAR_CALL_REDRAW: // set by handlers, then altered after (rarely occurs here)
|
4741
|
|
- case LCDVIEW_CALL_REDRAW_NEXT: // set by handlers, then altered after (never occurs here?)
|
4742
|
|
- lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
4743
|
|
- case LCDVIEW_REDRAW_NOW: // set above, or by a handler through LCDVIEW_CALL_REDRAW_NEXT
|
4744
|
|
- case LCDVIEW_NONE:
|
4745
|
|
- break;
|
4746
|
|
- } // switch
|
4747
|
|
- }
|
|
4739
|
+
|
|
4740
|
+ if (!IS_DRAWING) switch (lcdDrawUpdate) {
|
|
4741
|
+ case LCDVIEW_CALL_NO_REDRAW:
|
|
4742
|
+ lcdDrawUpdate = LCDVIEW_NONE;
|
|
4743
|
+ break;
|
|
4744
|
+ case LCDVIEW_CLEAR_CALL_REDRAW: // set by handlers, then altered after (rarely occurs here)
|
|
4745
|
+ case LCDVIEW_CALL_REDRAW_NEXT: // set by handlers, then altered after (never occurs here?)
|
|
4746
|
+ lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
|
4747
|
+ case LCDVIEW_REDRAW_NOW: // set above, or by a handler through LCDVIEW_CALL_REDRAW_NEXT
|
|
4748
|
+ case LCDVIEW_NONE:
|
|
4749
|
+ break;
|
|
4750
|
+ } // switch
|
4748
|
4751
|
|
4749
|
4752
|
#if ENABLED(ADC_KEYPAD)
|
4750
|
4753
|
buttons_reprapworld_keypad = 0;
|
|
@@ -4756,19 +4759,18 @@ void lcd_update() {
|
4756
|
4759
|
#define CURRENTSCREEN() lcd_status_screen()
|
4757
|
4760
|
#endif
|
4758
|
4761
|
|
4759
|
|
- #if ENABLED(DOGLCD) // Changes due to different driver architecture of the DOGM display
|
4760
|
|
- if (!drawing_screen) {
|
4761
|
|
-#if defined(TARGET_LPC1768)
|
4762
|
|
-digitalWrite(P1_4, !digitalRead(P1_4)); //re-arm (was 77 in the old system)
|
4763
|
|
-#else
|
4764
|
|
-digitalWrite(29, !digitalRead(29)); //2560
|
4765
|
|
-#endif
|
4766
|
|
- u8g.firstPage();
|
4767
|
|
- drawing_screen = 1;
|
|
4762
|
+ #if ENABLED(DOGLCD)
|
|
4763
|
+ if (!drawing_screen) { // If not already drawing pages
|
|
4764
|
+ u8g.firstPage(); // Start the first page
|
|
4765
|
+ drawing_screen = 1; // Flag as drawing pages
|
4768
|
4766
|
}
|
4769
|
|
- lcd_setFont(FONT_MENU);
|
4770
|
|
- u8g.setColorIndex(1);
|
4771
|
|
- CURRENTSCREEN();
|
|
4767
|
+ lcd_setFont(FONT_MENU); // Setup font for every page draw
|
|
4768
|
+ u8g.setColorIndex(1); // And reset the color
|
|
4769
|
+ CURRENTSCREEN(); // Draw and process the current screen
|
|
4770
|
+
|
|
4771
|
+ // The screen handler can clear drawing_screen for an action that changes the screen.
|
|
4772
|
+ // If still drawing and there's another page, update max-time and return now.
|
|
4773
|
+ // The nextPage will already be set up on the next call.
|
4772
|
4774
|
if (drawing_screen && (drawing_screen = u8g.nextPage())) {
|
4773
|
4775
|
NOLESS(max_display_update_time, millis() - ms);
|
4774
|
4776
|
return;
|
|
@@ -4776,6 +4778,9 @@ digitalWrite(29, !digitalRead(29)); //2560
|
4776
|
4778
|
#else
|
4777
|
4779
|
CURRENTSCREEN();
|
4778
|
4780
|
#endif
|
|
4781
|
+
|
|
4782
|
+ // Keeping track of the longest time for an individual LCD update.
|
|
4783
|
+ // Used to do screen throttling when the planner starts to fill up.
|
4779
|
4784
|
NOLESS(max_display_update_time, millis() - ms);
|
4780
|
4785
|
}
|
4781
|
4786
|
|
|
@@ -4789,23 +4794,19 @@ digitalWrite(29, !digitalRead(29)); //2560
|
4789
|
4794
|
|
4790
|
4795
|
#endif // ULTIPANEL
|
4791
|
4796
|
|
4792
|
|
- #if ENABLED(DOGLCD)
|
4793
|
|
- if (!drawing_screen)
|
4794
|
|
- #endif
|
4795
|
|
- {
|
4796
|
|
- switch (lcdDrawUpdate) {
|
4797
|
|
- case LCDVIEW_CLEAR_CALL_REDRAW:
|
4798
|
|
- lcd_implementation_clear();
|
4799
|
|
- case LCDVIEW_CALL_REDRAW_NEXT:
|
4800
|
|
- lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
4801
|
|
- break;
|
4802
|
|
- case LCDVIEW_REDRAW_NOW:
|
4803
|
|
- lcdDrawUpdate = LCDVIEW_NONE;
|
4804
|
|
- break;
|
4805
|
|
- case LCDVIEW_NONE:
|
4806
|
|
- break;
|
4807
|
|
- } // switch
|
4808
|
|
- }
|
|
4797
|
+ if (!IS_DRAWING) switch (lcdDrawUpdate) {
|
|
4798
|
+ case LCDVIEW_CLEAR_CALL_REDRAW:
|
|
4799
|
+ lcd_implementation_clear();
|
|
4800
|
+ case LCDVIEW_CALL_REDRAW_NEXT:
|
|
4801
|
+ lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
|
4802
|
+ break;
|
|
4803
|
+ case LCDVIEW_REDRAW_NOW:
|
|
4804
|
+ lcdDrawUpdate = LCDVIEW_NONE;
|
|
4805
|
+ break;
|
|
4806
|
+ case LCDVIEW_NONE:
|
|
4807
|
+ break;
|
|
4808
|
+ } // switch
|
|
4809
|
+
|
4809
|
4810
|
} // ELAPSED(ms, next_lcd_update_ms)
|
4810
|
4811
|
}
|
4811
|
4812
|
|