From 5054c539019b494476917dc820b6b6581be47cfe Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Sun, 4 Feb 2018 17:23:39 -0600
Subject: [PATCH] Export more in ultralcd.h

Closer parity with 2.0.x
---
 Marlin/Marlin_main.cpp |  6 ------
 Marlin/ubl_G29.cpp     | 13 ++-----------
 Marlin/ultralcd.cpp    |  8 ++------
 Marlin/ultralcd.h      | 40 ++++++++++++++++++++++++++--------------
 4 files changed, 30 insertions(+), 37 deletions(-)

diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp
index ec8be17091..d23ec14888 100644
--- a/Marlin/Marlin_main.cpp
+++ b/Marlin/Marlin_main.cpp
@@ -4078,12 +4078,6 @@ void home_all_axes() { gcode_G28(true); }
 
 #if ENABLED(MESH_BED_LEVELING) || ENABLED(PROBE_MANUALLY)
 
-  #if ENABLED(LCD_BED_LEVELING)
-    extern bool lcd_wait_for_move;
-  #else
-    constexpr bool lcd_wait_for_move = false;
-  #endif
-
   inline void _manual_goto_xy(const float &rx, const float &ry) {
 
     #if MANUAL_PROBE_HEIGHT > 0
diff --git a/Marlin/ubl_G29.cpp b/Marlin/ubl_G29.cpp
index 39fe9d0bde..99eadc5cd1 100644
--- a/Marlin/ubl_G29.cpp
+++ b/Marlin/ubl_G29.cpp
@@ -44,21 +44,12 @@
 
   #if ENABLED(NEWPANEL)
     void lcd_return_to_status();
-    void lcd_mesh_edit_setup(const float initial);
-    float lcd_mesh_edit();
-    void lcd_z_offset_edit_setup(float);
-    extern void _lcd_ubl_output_map_lcd();
-    float lcd_z_offset_edit();
+    void _lcd_ubl_output_map_lcd();
   #endif
 
   extern float meshedit_done;
   extern long babysteps_done;
-  extern float probe_pt(const float &rx, const float &ry, const bool, const uint8_t, const bool=true);
-  extern bool set_probe_deployed(bool);
-  extern void set_bed_leveling_enabled(bool);
-
-  typedef void (*screenFunc_t)();
-  extern void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder=0);
+  float probe_pt(const float &rx, const float &ry, const bool, const uint8_t, const bool=true);
 
   #define SIZE_OF_LITTLE_RAISE 1
   #define BIG_RAISE_NOT_NEEDED 0
diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp
index f246a5c636..ac3abdab8a 100644
--- a/Marlin/ultralcd.cpp
+++ b/Marlin/ultralcd.cpp
@@ -156,10 +156,6 @@ uint16_t max_display_update_time = 0;
     #define TALL_FONT_CORRECTION 0
   #endif
 
-  // Function pointer to menu functions.
-  typedef void (*screenFunc_t)();
-  typedef void (*menuAction_t)();
-
   #if HAS_POWER_SWITCH
     extern bool powersupply_on;
   #endif
@@ -1200,7 +1196,7 @@ void kill_screen(const char* lcd_msg) {
       return mesh_edit_value;
     }
 
-    void lcd_mesh_edit_setup(const float initial) {
+    void lcd_mesh_edit_setup(const float &initial) {
       mesh_edit_value = mesh_edit_accumulator = initial;
       lcd_goto_screen(_lcd_mesh_edit_NOP);
     }
@@ -1214,7 +1210,7 @@ void kill_screen(const char* lcd_msg) {
       return mesh_edit_value;
     }
 
-    void lcd_z_offset_edit_setup(float initial) {
+    void lcd_z_offset_edit_setup(const float &initial) {
       mesh_edit_value = mesh_edit_accumulator = initial;
       lcd_goto_screen(_lcd_z_offset_edit);
     }
diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h
index 02e0cb5047..484c0c3bf5 100644
--- a/Marlin/ultralcd.h
+++ b/Marlin/ultralcd.h
@@ -31,9 +31,8 @@
 
   #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION)
     extern bool lcd_external_control;
-    #if ENABLED(G26_MESH_VALIDATION)
-      void lcd_chirp();
-    #endif
+  #else
+    constexpr bool lcd_external_control = false;
   #endif
 
   #define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0)
@@ -83,6 +82,14 @@
 
   #if ENABLED(ULTIPANEL)
 
+    extern bool defer_return_to_status;
+
+    // Function pointer to menu functions.
+    typedef void (*screenFunc_t)();
+    typedef void (*menuAction_t)();
+
+    void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder=0);
+
     #define BLEN_A 0
     #define BLEN_B 1
     // Encoder click is directly connected
@@ -99,11 +106,27 @@
     void lcd_completion_feedback(const bool good=true);
 
     #if ENABLED(ADVANCED_PAUSE_FEATURE)
+      extern uint8_t active_extruder;
       void lcd_advanced_pause_show_message(const AdvancedPauseMessage message,
                                            const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT,
                                            const uint8_t extruder=active_extruder);
     #endif // ADVANCED_PAUSE_FEATURE
 
+    #if ENABLED(G26_MESH_VALIDATION)
+      void lcd_chirp();
+    #endif
+
+    #if ENABLED(AUTO_BED_LEVELING_UBL)
+      void lcd_mesh_edit_setup(const float &initial);
+      float lcd_mesh_edit();
+      void lcd_z_offset_edit_setup(const float &initial);
+      float lcd_z_offset_edit();
+    #endif
+
+    #if ENABLED(DELTA_AUTO_CALIBRATION) && !HAS_BED_PROBE
+      float lcd_probe_pt(const float &rx, const float &ry);
+    #endif
+
   #else
 
     inline void lcd_buttons_update() {}
@@ -208,17 +231,6 @@
 
 void lcd_reset_status();
 
-#if ENABLED(AUTO_BED_LEVELING_UBL)
-  void lcd_mesh_edit_setup(const float initial);
-  float lcd_mesh_edit();
-  void lcd_z_offset_edit_setup(float);
-  float lcd_z_offset_edit();
-#endif
-
-#if ENABLED(DELTA_AUTO_CALIBRATION) && !HAS_BED_PROBE
-  float lcd_probe_pt(const float &rx, const float &ry);
-#endif
-
 #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
   void lcd_reselect_last_file();
 #endif