Browse Source

Reorganize includes and declarations

Scott Lahteine 6 years ago
parent
commit
b063b1b722

+ 2
- 2
Marlin/src/lcd/HD44780/ultralcd_common_HD44780.h View File

@@ -50,8 +50,6 @@
50 50
   #endif
51 51
 #endif
52 52
 
53
-extern volatile uint8_t buttons;  //an extended version of the last checked buttons in a bit array.
54
-
55 53
 ////////////////////////////////////
56 54
 // Setup button and encode mappings for each panel (into 'buttons' variable
57 55
 //
@@ -61,6 +59,8 @@ extern volatile uint8_t buttons;  //an extended version of the last checked butt
61 59
 
62 60
 #if ENABLED(ULTIPANEL)
63 61
 
62
+  extern volatile uint8_t buttons;
63
+
64 64
   //
65 65
   // Setup other button mappings of each panel
66 66
   //

+ 23
- 28
Marlin/src/lcd/menu/menu.cpp View File

@@ -25,34 +25,32 @@
25 25
 #if ENABLED(ULTIPANEL)
26 26
 
27 27
 #include "menu.h"
28
-
29 28
 #include "../ultralcd.h"
30 29
 #include "../../module/planner.h"
31 30
 #include "../../module/motion.h"
32
-#include "../../module/probe.h"
33
-#include "../../module/printcounter.h"
34
-#include "../../gcode/gcode.h"
35 31
 #include "../../gcode/queue.h"
36
-#include "../../module/configuration_store.h"
37
-#include "../../module/tool_change.h"
38
-#include "../../Marlin.h"
32
+#include "../../sd/cardreader.h"
39 33
 
40
-#include <stdarg.h>
34
+#if ENABLED(EEPROM_SETTINGS)
35
+  #include "../../module/configuration_store.h"
36
+#endif
37
+
38
+#if WATCH_HOTENDS || WATCH_THE_BED
39
+  #include "../../module/temperature.h"
40
+#endif
41 41
 
42
-#if ENABLED(SDSUPPORT)
43
-  #include "../../sd/cardreader.h"
42
+#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
43
+  #include "../../module/probe.h"
44
+#endif
45
+
46
+#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) || ENABLED(AUTO_BED_LEVELING_UBL)
47
+  #include "../../feature/bedlevel/bedlevel.h"
44 48
 #endif
45 49
 
46 50
 ////////////////////////////////////////////
47 51
 ///////////// Global Variables /////////////
48 52
 ////////////////////////////////////////////
49 53
 
50
-// Buttons
51
-volatile uint8_t buttons;
52
-#if ENABLED(REPRAPWORLD_KEYPAD)
53
-  volatile uint8_t buttons_reprapworld_keypad;
54
-#endif
55
-
56 54
 // Menu Navigation
57 55
 int8_t encoderTopLine;
58 56
 typedef struct {
@@ -70,12 +68,9 @@ int32_t minEditValue, maxEditValue;
70 68
 screenFunc_t callbackFunc;
71 69
 bool liveEdit;
72 70
 
71
+// Prevent recursion into screen handlers
73 72
 bool no_reentry = false;
74 73
 
75
-// Initialized by settings.load()
76
-int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2];
77
-uint8_t lcd_preheat_fan_speed[2];
78
-
79 74
 ////////////////////////////////////////////
80 75
 //////// Menu Navigation & History /////////
81 76
 ////////////////////////////////////////////
@@ -110,7 +105,7 @@ void lcd_goto_previous_menu_no_defer() {
110 105
 }
111 106
 
112 107
 ////////////////////////////////////////////
113
-/////////////// Menu Actions ///////////////
108
+/////////// Common Menu Actions ////////////
114 109
 ////////////////////////////////////////////
115 110
 
116 111
 void _menu_action_back() { lcd_goto_previous_menu(); }
@@ -355,14 +350,14 @@ void lcd_completion_feedback(const bool good/*=true*/) {
355 350
   else lcd_buzz(20, 440);
356 351
 }
357 352
 
358
-inline void line_to_current_z() {
359
-  planner.buffer_line(current_position, MMM_TO_MMS(manual_feedrate_mm_m[Z_AXIS]), active_extruder);
360
-}
353
+#if HAS_LINE_TO_Z
361 354
 
362
-void line_to_z(const float &z) {
363
-  current_position[Z_AXIS] = z;
364
-  line_to_current_z();
365
-}
355
+  void line_to_z(const float &z) {
356
+    current_position[Z_AXIS] = z;
357
+    planner.buffer_line(current_position, MMM_TO_MMS(manual_feedrate_mm_m[Z_AXIS]), active_extruder);
358
+  }
359
+
360
+#endif
366 361
 
367 362
 #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
368 363
 

+ 6
- 1
Marlin/src/lcd/menu/menu.h View File

@@ -348,7 +348,6 @@ void menu_move();
348 348
 
349 349
 void lcd_move_z();
350 350
 void lcd_synchronize(PGM_P const msg=NULL);
351
-void line_to_z(const float &z);
352 351
 void _lcd_draw_homing();
353 352
 
354 353
 void watch_temp_callback_E0();
@@ -359,6 +358,12 @@ void watch_temp_callback_E4();
359 358
 void watch_temp_callback_E5();
360 359
 void watch_temp_callback_bed();
361 360
 
361
+#define HAS_LINE_TO_Z (ENABLED(DELTA) || ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING) || ENABLED(LEVEL_BED_CORNERS))
362
+
363
+#if HAS_LINE_TO_Z
364
+  void line_to_z(const float &z);
365
+#endif
366
+
362 367
 #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE)
363 368
   void lcd_enqueue_command(const char * const cmd);
364 369
   void lcd_enqueue_commands_P(PGM_P const cmd);

+ 2
- 0
Marlin/src/lcd/menu/menu_delta_calibrate.cpp View File

@@ -45,6 +45,8 @@ void _man_probe_pt(const float &rx, const float &ry) {
45 45
 
46 46
 #if ENABLED(DELTA_AUTO_CALIBRATION)
47 47
 
48
+  #include "../../gcode/gcode.h"
49
+
48 50
   float lcd_probe_pt(const float &rx, const float &ry) {
49 51
     _man_probe_pt(rx, ry);
50 52
     KEEPALIVE_STATE(PAUSED_FOR_USER);

+ 4
- 0
Marlin/src/lcd/menu/menu_temperature.cpp View File

@@ -35,6 +35,10 @@
35 35
   #include "../../module/motion.h"
36 36
 #endif
37 37
 
38
+// Initialized by settings.load()
39
+int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2];
40
+uint8_t lcd_preheat_fan_speed[2];
41
+
38 42
 //
39 43
 // "Temperature" submenu items
40 44
 //

+ 7
- 0
Marlin/src/lcd/ultralcd.cpp View File

@@ -74,6 +74,9 @@
74 74
   #include "../libs/buzzer.h"
75 75
 #endif
76 76
 
77
+// Buttons
78
+volatile uint8_t buttons;
79
+
77 80
 #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
78 81
   uint8_t lcd_sd_status;
79 82
 #endif
@@ -219,6 +222,10 @@ bool lcd_blink() {
219 222
 ///////////// Keypad Handling //////////////
220 223
 ////////////////////////////////////////////
221 224
 
225
+#if ENABLED(REPRAPWORLD_KEYPAD)
226
+  volatile uint8_t buttons_reprapworld_keypad;
227
+#endif
228
+
222 229
 #if ENABLED(ADC_KEYPAD)
223 230
 
224 231
   #define KEYPAD_HOME EN_REPRAPWORLD_KEYPAD_F1

Loading…
Cancel
Save