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
   #endif
50
   #endif
51
 #endif
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
 // Setup button and encode mappings for each panel (into 'buttons' variable
54
 // Setup button and encode mappings for each panel (into 'buttons' variable
57
 //
55
 //
61
 
59
 
62
 #if ENABLED(ULTIPANEL)
60
 #if ENABLED(ULTIPANEL)
63
 
61
 
62
+  extern volatile uint8_t buttons;
63
+
64
   //
64
   //
65
   // Setup other button mappings of each panel
65
   // Setup other button mappings of each panel
66
   //
66
   //

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

25
 #if ENABLED(ULTIPANEL)
25
 #if ENABLED(ULTIPANEL)
26
 
26
 
27
 #include "menu.h"
27
 #include "menu.h"
28
-
29
 #include "../ultralcd.h"
28
 #include "../ultralcd.h"
30
 #include "../../module/planner.h"
29
 #include "../../module/planner.h"
31
 #include "../../module/motion.h"
30
 #include "../../module/motion.h"
32
-#include "../../module/probe.h"
33
-#include "../../module/printcounter.h"
34
-#include "../../gcode/gcode.h"
35
 #include "../../gcode/queue.h"
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
 #endif
48
 #endif
45
 
49
 
46
 ////////////////////////////////////////////
50
 ////////////////////////////////////////////
47
 ///////////// Global Variables /////////////
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
 // Menu Navigation
54
 // Menu Navigation
57
 int8_t encoderTopLine;
55
 int8_t encoderTopLine;
58
 typedef struct {
56
 typedef struct {
70
 screenFunc_t callbackFunc;
68
 screenFunc_t callbackFunc;
71
 bool liveEdit;
69
 bool liveEdit;
72
 
70
 
71
+// Prevent recursion into screen handlers
73
 bool no_reentry = false;
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
 //////// Menu Navigation & History /////////
75
 //////// Menu Navigation & History /////////
81
 ////////////////////////////////////////////
76
 ////////////////////////////////////////////
110
 }
105
 }
111
 
106
 
112
 ////////////////////////////////////////////
107
 ////////////////////////////////////////////
113
-/////////////// Menu Actions ///////////////
108
+/////////// Common Menu Actions ////////////
114
 ////////////////////////////////////////////
109
 ////////////////////////////////////////////
115
 
110
 
116
 void _menu_action_back() { lcd_goto_previous_menu(); }
111
 void _menu_action_back() { lcd_goto_previous_menu(); }
355
   else lcd_buzz(20, 440);
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
 #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
362
 #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
368
 
363
 

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

348
 
348
 
349
 void lcd_move_z();
349
 void lcd_move_z();
350
 void lcd_synchronize(PGM_P const msg=NULL);
350
 void lcd_synchronize(PGM_P const msg=NULL);
351
-void line_to_z(const float &z);
352
 void _lcd_draw_homing();
351
 void _lcd_draw_homing();
353
 
352
 
354
 void watch_temp_callback_E0();
353
 void watch_temp_callback_E0();
359
 void watch_temp_callback_E5();
358
 void watch_temp_callback_E5();
360
 void watch_temp_callback_bed();
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
 #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE)
367
 #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE)
363
   void lcd_enqueue_command(const char * const cmd);
368
   void lcd_enqueue_command(const char * const cmd);
364
   void lcd_enqueue_commands_P(PGM_P const cmd);
369
   void lcd_enqueue_commands_P(PGM_P const cmd);

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

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

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

35
   #include "../../module/motion.h"
35
   #include "../../module/motion.h"
36
 #endif
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
 // "Temperature" submenu items
43
 // "Temperature" submenu items
40
 //
44
 //

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

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

Loading…
Cancel
Save