Browse Source

LCD updates

Scott Lahteine 6 years ago
parent
commit
0fcec02db5

+ 82
- 89
Marlin/src/lcd/dogm/ultralcd_st7565_u8glib_VIKI.h View File

@@ -23,21 +23,20 @@
23 23
 #ifndef ULCDST7565_H
24 24
 #define ULCDST7565_H
25 25
 
26
-#include "Marlin.h"
27
-
28
-#if ENABLED(U8GLIB_ST7565_64128N)
26
+#include "../../inc/MarlinConfig.h"
29 27
 
28
+#if !( defined(DOGLCD_SCK) && DOGLCD_SCK >= 0 \
29
+    && defined(DOGLCD_MOSI) && DOGLCD_MOSI >= 0 \
30
+    && defined(DOGLCD_CS) && DOGLCD_CS >= 0 \
31
+    && defined(DOGLCD_A0) && DOGLCD_A0 >= 0 )
32
+  #error "DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, and DOGLCD_A0 are required for VIKI."
33
+#endif
30 34
 
31 35
 #define ST7565_CLK_PIN  DOGLCD_SCK
32 36
 #define ST7565_DAT_PIN  DOGLCD_MOSI
33 37
 #define ST7565_CS_PIN   DOGLCD_CS
34 38
 #define ST7565_A0_PIN   DOGLCD_A0
35 39
 
36
-
37
-
38
-
39
-
40
-
41 40
 #include <U8glib.h>
42 41
 
43 42
 #define WIDTH 128
@@ -116,119 +115,116 @@ static void ST7565_SWSPI_SND_8BIT(uint8_t val) {
116 115
   #define U8G_DELAY u8g_10MicroDelay()
117 116
 #endif
118 117
 
119
-#define ST7565_CS()                          { WRITE(ST7565_CS_PIN,1); U8G_DELAY; }
120
-#define ST7565_NCS()                         { WRITE(ST7565_CS_PIN,0); }
121
-#define ST7565_A0()                          { WRITE(ST7565_A0_PIN,1); U8G_DELAY; }
122
-#define ST7565_NA0()                         { WRITE(ST7565_A0_PIN,0); }
123
-#define ST7565_WRITE_BYTE(a)                 { ST7565_SWSPI_SND_8BIT((uint8_t)a); U8G_DELAY; }
124
-#define ST7560_WriteSequence(count, pointer) { uint8_t *ptr = pointer; for (uint8_t i = 0; i <  count; i++) {ST7565_SWSPI_SND_8BIT( *ptr++);} DELAY_10US; }
118
+#define ST7565_CS()                          do{ WRITE(ST7565_CS_PIN, HIGH); U8G_DELAY; }while(0)
119
+#define ST7565_NCS()                         WRITE(ST7565_CS_PIN, LOW)
120
+#define ST7565_A0()                          do{ WRITE(ST7565_A0_PIN, HIGH); U8G_DELAY; }while(0)
121
+#define ST7565_NA0()                         WRITE(ST7565_A0_PIN, LOW)
122
+#define ST7565_WRITE_BYTE(a)                 do{ ST7565_SWSPI_SND_8BIT((uint8_t)a); U8G_DELAY; }while(0)
123
+#define ST7560_WriteSequence(count, pointer) do{ uint8_t *ptr = pointer; for (uint8_t i = 0; i < count; ++i) { ST7565_SWSPI_SND_8BIT(*ptr++); } DELAY_10US; }while(0)
125 124
 
126 125
 
127 126
 uint8_t u8g_dev_st7565_64128n_2x_VIKI_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) {
128 127
   switch (msg) {
129
-    case U8G_DEV_MSG_INIT:
130
-    { OUT_WRITE(ST7565_CS_PIN, LOW);
128
+    case U8G_DEV_MSG_INIT: {
129
+      OUT_WRITE(ST7565_CS_PIN, LOW);
131 130
       OUT_WRITE(ST7565_DAT_PIN, LOW);
132 131
       OUT_WRITE(ST7565_CLK_PIN, LOW);
133 132
       OUT_WRITE(ST7565_A0_PIN, LOW);
134 133
 
135
-      ST7565_CS();                      /* disable chip */
136
-      ST7565_NA0();                     /* instruction mode */
137
-      ST7565_NCS();                     /* enable chip */
138
-
139
-
140
-      ST7565_WRITE_BYTE(0x0A2);         /* 0x0a2: LCD bias 1/9 (according to Displaytech 64128N datasheet) */
141
-      ST7565_WRITE_BYTE(0x0A0);         /* Normal ADC Select (according to Displaytech 64128N datasheet) */
134
+      ST7565_CS();                      // disable chip
135
+      ST7565_NA0();                     // instruction mode
136
+      ST7565_NCS();                     // enable chip
142 137
 
143
-      ST7565_WRITE_BYTE(0x0c8);         /* common output mode: set scan direction normal operation/SHL Select; 0x0c0 --> SHL = 0; normal; 0x0c8 --> SHL = 1 */
144
-      ST7565_WRITE_BYTE(0x040);         /* Display start line for Displaytech 64128N */
138
+      ST7565_WRITE_BYTE(0xA2);          // 0xA2: LCD bias 1/9 (according to Displaytech 64128N datasheet)
139
+      ST7565_WRITE_BYTE(0xA0);          // Normal ADC Select (according to Displaytech 64128N datasheet)
145 140
 
146
-      ST7565_WRITE_BYTE(0x028 | 0x04);  /* power control: turn on voltage converter */
147
-//    U8G_ESC_DLY(50);                  /* delay 50 ms - hangs after a reset if used */ 
141
+      ST7565_WRITE_BYTE(0xC8);          // common output mode: set scan direction normal operation/SHL Select; 0xC0 --> SHL = 0; normal; 0xC8 --> SHL = 1
142
+      ST7565_WRITE_BYTE(0x40);          // Display start line for Displaytech 64128N
148 143
 
149
-      ST7565_WRITE_BYTE(0x028 | 0x06);  /* power control: turn on voltage regulator */
150
-//    U8G_ESC_DLY(50);                  /* delay 50 ms - hangs after a reset if used */ 
144
+      ST7565_WRITE_BYTE(0x28 | 0x04);   // power control: turn on voltage converter
145
+      //U8G_ESC_DLY(50);                  // delay 50 ms - hangs after a reset if used 
151 146
 
152
-      ST7565_WRITE_BYTE(0x028 | 0x07);  /* power control: turn on voltage follower */
153
-//   U8G_ESC_DLY(50);                   /* delay 50 ms - hangs after a reset if used */ 
147
+      ST7565_WRITE_BYTE(0x28 | 0x06);   // power control: turn on voltage regulator
148
+      //U8G_ESC_DLY(50);                  // delay 50 ms - hangs after a reset if used 
154 149
 
155
-      ST7565_WRITE_BYTE(0x010);         /* Set V0 voltage resistor ratio. Setting for controlling brightness of Displaytech 64128N */
150
+      ST7565_WRITE_BYTE(0x28 | 0x07);   // power control: turn on voltage follower
151
+      //U8G_ESC_DLY(50);                  // delay 50 ms - hangs after a reset if used 
156 152
 
157
-      ST7565_WRITE_BYTE(0x0a6);         /* display normal, bit val 0: LCD pixel off. */
153
+      ST7565_WRITE_BYTE(0x10);          // Set V0 voltage resistor ratio. Setting for controlling brightness of Displaytech 64128N
158 154
 
159
-      ST7565_WRITE_BYTE(0x081);         /* set contrast */
160
-      ST7565_WRITE_BYTE(0x01e);         /* Contrast value. Setting for controlling brightness of Displaytech 64128N */
155
+      ST7565_WRITE_BYTE(0xA6);          // display normal, bit val 0: LCD pixel off.
161 156
 
157
+      ST7565_WRITE_BYTE(0x81);          // set contrast
158
+      ST7565_WRITE_BYTE(0x1E);          // Contrast value. Setting for controlling brightness of Displaytech 64128N
162 159
 
163
-      ST7565_WRITE_BYTE(0x0af);         /* display on */
160
+      ST7565_WRITE_BYTE(0xAF);          // display on
164 161
 
165
-      U8G_ESC_DLY(100);                 /* delay 100 ms */
166
-      ST7565_WRITE_BYTE(0x0a5);         /* display all points; ST7565 */
167
-      U8G_ESC_DLY(100);                 /* delay 100 ms */
168
-      U8G_ESC_DLY(100);                 /* delay 100 ms */
169
-      ST7565_WRITE_BYTE(0x0a4);         /* normal display */
170
-      ST7565_CS();                      /* disable chip */
171
-    }                                   /* end of sequence */
162
+      U8G_ESC_DLY(100);                 // delay 100 ms
163
+      ST7565_WRITE_BYTE(0xA5);          // display all points; ST7565
164
+      U8G_ESC_DLY(100);                 // delay 100 ms
165
+      U8G_ESC_DLY(100);                 // delay 100 ms
166
+      ST7565_WRITE_BYTE(0xA4);          // normal display
167
+      ST7565_CS();                      // disable chip
168
+    }                                   // end of sequence
172 169
       break;
173 170
     case U8G_DEV_MSG_STOP:
174 171
       break;
175
-    case U8G_DEV_MSG_PAGE_NEXT:
176
-    { u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
177
-      ST7565_CS();                      /* disable chip */
178
-      ST7565_NA0();                     /* instruction mode */
179
-      ST7565_NCS();                     /* enable chip */
180
-      ST7565_WRITE_BYTE(0x010);         /* set upper 4 bit of the col adr to 0x10 */
181
-      ST7565_WRITE_BYTE(0x000);         /* set lower 4 bit of the col adr to 0x00. Changed for DisplayTech 64128N */
182
-                                        /* end of sequence */
183
-      ST7565_WRITE_BYTE(0x0b0 | (2*pb->p.page));; /* select current page (ST7565R) */
184
-      ST7565_A0();                      /* data mode */
185
-      ST7560_WriteSequence( (uint8_t) pb->width, (uint8_t *)pb->buf);
186
-      ST7565_CS();                      /* disable chip */
187
-      ST7565_NA0();                     /* instruction mode */
188
-      ST7565_NCS();                     /* enable chip */
189
-      ST7565_WRITE_BYTE(0x010);         /* set upper 4 bit of the col adr to 0x10 */
190
-      ST7565_WRITE_BYTE(0x000);         /* set lower 4 bit of the col adr to 0x00. Changed for DisplayTech 64128N */
191
-                                        /* end of sequence */
192
-      ST7565_WRITE_BYTE(0x0b0 | (2*pb->p.page+1)); /* select current page (ST7565R) */
193
-      ST7565_A0();                      /* data mode */
194
-      ST7560_WriteSequence( (uint8_t) pb->width, (uint8_t *)(pb->buf)+pb->width);
195
-      ST7565_CS();                      /* disable chip */
172
+    case U8G_DEV_MSG_PAGE_NEXT: {
173
+      u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
174
+      ST7565_CS();                      // disable chip
175
+      ST7565_NA0();                     // instruction mode
176
+      ST7565_NCS();                     // enable chip
177
+      ST7565_WRITE_BYTE(0x10);          // set upper 4 bit of the col adr to 0x10
178
+      ST7565_WRITE_BYTE(0x00);          // set lower 4 bit of the col adr to 0x00. Changed for DisplayTech 64128N
179
+                                        // end of sequence
180
+      ST7565_WRITE_BYTE(0xB0 | (2 * pb->p.page)); // select current page (ST7565R)
181
+      ST7565_A0();                      // data mode
182
+      ST7560_WriteSequence((uint8_t)pb->width, (uint8_t*)pb->buf);
183
+      ST7565_CS();                      // disable chip
184
+      ST7565_NA0();                     // instruction mode
185
+      ST7565_NCS();                     // enable chip
186
+      ST7565_WRITE_BYTE(0x10);          // set upper 4 bit of the col adr to 0x10
187
+      ST7565_WRITE_BYTE(0x00);          // set lower 4 bit of the col adr to 0x00. Changed for DisplayTech 64128N
188
+                                        // end of sequence
189
+      ST7565_WRITE_BYTE(0xB0 | (2 * pb->p.page + 1)); // select current page (ST7565R)
190
+      ST7565_A0();                      // data mode
191
+      ST7560_WriteSequence((uint8_t)pb->width, (uint8_t*)(pb->buf)+pb->width);
192
+      ST7565_CS();                      // disable chip
196 193
     }
197 194
       break;
198 195
     case U8G_DEV_MSG_CONTRAST:
199 196
       ST7565_NCS();
200
-      ST7565_NA0();                     /* instruction mode */
201
-      ST7565_WRITE_BYTE(0x081);
197
+      ST7565_NA0();                     // instruction mode
198
+      ST7565_WRITE_BYTE(0x81);
202 199
       ST7565_WRITE_BYTE((*(uint8_t *)arg) >> 2);
203
-      ST7565_CS();                      /* disable chip */
200
+      ST7565_CS();                      // disable chip
204 201
       return 1;
205 202
     case U8G_DEV_MSG_SLEEP_ON:
206
-      ST7565_NA0();                     /* instruction mode */
207
-      ST7565_NCS();                     /* enable chip */
208
-      ST7565_WRITE_BYTE(0x0ac);         /* static indicator off */
209
-      ST7565_WRITE_BYTE(0x000);         /* indicator register set (not sure if this is required) */
210
-      ST7565_WRITE_BYTE(0x0ae);         /* display off */
211
-      ST7565_WRITE_BYTE(0x0a5);         /* all points on */
212
-      ST7565_CS();                      /* disable chip , bugfix 12 nov 2014 */
213
-                                        /* end of sequence */
203
+      ST7565_NA0();                     // instruction mode
204
+      ST7565_NCS();                     // enable chip
205
+      ST7565_WRITE_BYTE(0xAC);          // static indicator off
206
+      ST7565_WRITE_BYTE(0x00);          // indicator register set (not sure if this is required)
207
+      ST7565_WRITE_BYTE(0xAE);          // display off
208
+      ST7565_WRITE_BYTE(0xA5);          // all points on
209
+      ST7565_CS();                      // disable chip , bugfix 12 nov 2014
210
+                                        // end of sequence
214 211
       return 1;
215 212
     case U8G_DEV_MSG_SLEEP_OFF:
216
-      ST7565_NA0();                     /* instruction mode */
217
-      ST7565_NCS();                     /* enable chip */
218
-      ST7565_WRITE_BYTE(0x0a4);         /* all points off */
219
-      ST7565_WRITE_BYTE(0x0af);         /* display on */
220
-      U8G_ESC_DLY(50);                  /* delay 50 ms */
221
-      ST7565_CS();                      /* disable chip ,  bugfix 12 nov 2014 */
222
-                                        /* end of sequence */
213
+      ST7565_NA0();                     // instruction mode
214
+      ST7565_NCS();                     // enable chip
215
+      ST7565_WRITE_BYTE(0xA4);          // all points off
216
+      ST7565_WRITE_BYTE(0xAF);          // display on
217
+      U8G_ESC_DLY(50);                  // delay 50 ms
218
+      ST7565_CS();                      // disable chip ,  bugfix 12 nov 2014
219
+                                        // end of sequence
223 220
       return 1;
224 221
   }
225 222
   return u8g_dev_pb16v1_base_fn(u8g, dev, msg, arg);
226 223
 }
227 224
 
228
-uint8_t u8g_dev_st7565_64128n_2x_VIKI_buf[WIDTH*2] U8G_NOCOMMON ;
229
-u8g_pb_t u8g_dev_st7565_64128n_2x_VIKI_pb = { {16, HEIGHT, 0, 0, 0},  WIDTH, u8g_dev_st7565_64128n_2x_VIKI_buf};
230
-u8g_dev_t u8g_dev_st7565_64128n_2x_VIKI_sw_spi = { u8g_dev_st7565_64128n_2x_VIKI_fn, &u8g_dev_st7565_64128n_2x_VIKI_pb, &u8g_com_null_fn};
231
-
225
+uint8_t u8g_dev_st7565_64128n_2x_VIKI_buf[WIDTH*2] U8G_NOCOMMON;
226
+u8g_pb_t u8g_dev_st7565_64128n_2x_VIKI_pb = { { 16, HEIGHT, 0, 0, 0 }, WIDTH, u8g_dev_st7565_64128n_2x_VIKI_buf };
227
+u8g_dev_t u8g_dev_st7565_64128n_2x_VIKI_sw_spi = { u8g_dev_st7565_64128n_2x_VIKI_fn, &u8g_dev_st7565_64128n_2x_VIKI_pb, &u8g_com_null_fn };
232 228
 
233 229
 class U8GLIB_ST7565_64128n_2x_VIKI : public U8GLIB {
234 230
   public:
@@ -240,9 +236,6 @@ class U8GLIB_ST7565_64128n_2x_VIKI : public U8GLIB {
240 236
     {  }  
241 237
 };
242 238
 
243
-
244
-
245 239
 #pragma GCC reset_options
246 240
 
247
-#endif // U8GLIB_ST7565
248 241
 #endif // ULCDST7565_H

+ 1
- 4
Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd.h View File

@@ -23,9 +23,7 @@
23 23
 #ifndef ULCDST7920_H
24 24
 #define ULCDST7920_H
25 25
 
26
-#include "Marlin.h"
27
-
28
-#if ENABLED(U8GLIB_ST7920)
26
+#include "../../Marlin.h"
29 27
 
30 28
 #define ST7920_CLK_PIN  LCD_PINS_D4
31 29
 #define ST7920_DAT_PIN  LCD_PINS_ENABLE
@@ -186,5 +184,4 @@ class U8GLIB_ST7920_128X64_RRD : public U8GLIB {
186 184
 
187 185
 #pragma GCC reset_options
188 186
 
189
-#endif // U8GLIB_ST7920
190 187
 #endif // ULCDST7920_H

+ 9
- 0
Marlin/src/lcd/thermistornames.h View File

@@ -20,6 +20,15 @@
20 20
  *
21 21
  */
22 22
 
23
+/**
24
+ * thermistornames.h
25
+ *
26
+ * Used by LCD code to obtain a thermistor name
27
+ *
28
+ * Usage: Set THERMISTOR_ID then #include this file
29
+ * to set a new value for THERMISTOR_NAME.
30
+ */
31
+
23 32
 #undef THERMISTOR_NAME
24 33
 
25 34
 // Thermcouples

+ 33
- 26
Marlin/src/lcd/ultralcd.cpp View File

@@ -20,33 +20,43 @@
20 20
  *
21 21
  */
22 22
 
23
-#include "ultralcd.h"
23
+#include "../inc/MarlinConfig.h"
24
+
24 25
 #if ENABLED(ULTRA_LCD)
25
-#include "Marlin.h"
26
-#include "language.h"
27
-#include "cardreader.h"
28
-#include "temperature.h"
29
-#include "planner.h"
30
-#include "stepper.h"
31
-#include "configuration_store.h"
32
-#include "utility.h"
26
+
27
+#include "ultralcd.h"
28
+
29
+#include "../sd/cardreader.h"
30
+#include "../module/temperature.h"
31
+#include "../module/planner.h"
32
+#include "../module/stepper.h"
33
+#include "../module/configuration_store.h"
34
+
35
+#include "../Marlin.h"
33 36
 
34 37
 #if HAS_BUZZER && DISABLED(LCD_USE_I2C_BUZZER)
35
-  #include "buzzer.h"
38
+  #include "../libs/buzzer.h"
36 39
 #endif
37 40
 
38 41
 #if ENABLED(PRINTCOUNTER)
39
-  #include "printcounter.h"
40
-  #include "duration_t.h"
42
+  #include "../module/printcounter.h"
43
+  #include "../libs/duration_t.h"
44
+#endif
45
+
46
+#if ENABLED(FILAMENT_LCD_DISPLAY)
47
+  #include "../feature/filwidth.h"
48
+#endif
49
+
50
+#if HAS_BED_PROBE
51
+  #include "../module/probe.h"
41 52
 #endif
42 53
 
43 54
 #if ENABLED(BLTOUCH)
44
-  #include "endstops.h"
55
+  #include "../module/endstops.h"
45 56
 #endif
46 57
 
47
-#if ENABLED(AUTO_BED_LEVELING_UBL)
48
-  #include "ubl.h"
49
-  bool ubl_lcd_map_control = false;
58
+#if HAS_LEVELING
59
+  #include "../feature/bedlevel/bedlevel.h"
50 60
 #endif
51 61
 
52 62
 // Initialized by settings.load()
@@ -92,7 +102,7 @@ uint16_t max_display_update_time = 0;
92 102
 #endif
93 103
 
94 104
 #if ENABLED(DAC_STEPPER_CURRENT)
95
-  #include "stepper_dac.h" //was dac_mcp4728.h MarlinMain uses stepper dac for the m-codes
105
+  #include "../feature/dac/stepper_dac.h" //was dac_mcp4728.h MarlinMain uses stepper dac for the m-codes
96 106
   uint8_t driverPercent[XYZE];
97 107
 #endif
98 108
 
@@ -102,9 +112,6 @@ uint16_t max_display_update_time = 0;
102 112
     #define TALL_FONT_CORRECTION 0
103 113
   #endif
104 114
 
105
-  // Function pointer to menu functions.
106
-  typedef void (*screenFunc_t)();
107
-
108 115
   #if HAS_POWER_SWITCH
109 116
     extern bool powersupply_on;
110 117
   #endif
@@ -161,7 +168,7 @@ uint16_t max_display_update_time = 0;
161 168
   #endif
162 169
 
163 170
   #if ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING)
164
-    #include "mesh_bed_leveling.h"
171
+    #include "../feature/mbl/mesh_bed_leveling.h"
165 172
     extern void mesh_probing_done();
166 173
   #endif
167 174
 
@@ -443,7 +450,7 @@ uint16_t max_display_update_time = 0;
443 450
   /**
444 451
    * General function to go directly to a screen
445 452
    */
446
-  void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0) {
453
+  void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) {
447 454
     if (currentScreen != screen) {
448 455
 
449 456
       #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) && ENABLED(BABYSTEPPING)
@@ -469,14 +476,14 @@ uint16_t max_display_update_time = 0;
469 476
       if (screen == lcd_status_screen) {
470 477
         defer_return_to_status = false;
471 478
         #if ENABLED(AUTO_BED_LEVELING_UBL)
472
-          ubl_lcd_map_control = false;
479
+          ubl.lcd_map_control = false;
473 480
         #endif
474 481
         screen_history_depth = 0;
475 482
       }
476 483
       lcd_implementation_clear();
477 484
       // Re-initialize custom characters that may be re-used
478 485
       #if DISABLED(DOGLCD) && ENABLED(AUTO_BED_LEVELING_UBL)
479
-        if (!ubl_lcd_map_control) lcd_set_custom_characters(
486
+        if (!ubl.lcd_map_control) lcd_set_custom_characters(
480 487
           #if ENABLED(LCD_PROGRESS_BAR)
481 488
             screen == lcd_status_screen
482 489
           #endif
@@ -928,7 +935,7 @@ void kill_screen(const char* lcd_msg) {
928 935
     #if ENABLED(SDSUPPORT)
929 936
       if (card.cardOK) {
930 937
         if (card.isFileOpen()) {
931
-          if (card.sdprinting)
938
+          if (IS_SD_PRINTING)
932 939
             MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause);
933 940
           else
934 941
             MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume);
@@ -2224,7 +2231,7 @@ void kill_screen(const char* lcd_msg) {
2224 2231
 
2225 2232
     void _lcd_ubl_map_homing() {
2226 2233
       defer_return_to_status = true;
2227
-      ubl_lcd_map_control = true; // Return to the map screen
2234
+      ubl.lcd_map_control = true; // Return to the map screen
2228 2235
       if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT < 3 ? 0 : (LCD_HEIGHT > 4 ? 2 : 1), PSTR(MSG_LEVEL_BED_HOMING));
2229 2236
       lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW;
2230 2237
       if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])

+ 27
- 12
Marlin/src/lcd/ultralcd.h View File

@@ -23,15 +23,21 @@
23 23
 #ifndef ULTRALCD_H
24 24
 #define ULTRALCD_H
25 25
 
26
-#include "Marlin.h"
26
+#include "../inc/MarlinConfig.h"
27 27
 
28 28
 #if ENABLED(ULTRA_LCD)
29 29
 
30
+  #include "../Marlin.h"
31
+
30 32
   #define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0)
31 33
   #define BUTTON_PRESSED(BN) !READ(BTN_## BN)
32 34
 
33 35
   extern int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
34 36
 
37
+  #if ENABLED(LCD_BED_LEVELING) && ENABLED(PROBE_MANUALLY)
38
+    extern bool lcd_wait_for_move;
39
+  #endif
40
+
35 41
   int16_t lcd_strlen(const char* s);
36 42
   int16_t lcd_strlen_P(const char* s);
37 43
   void lcd_update();
@@ -74,6 +80,11 @@
74 80
 
75 81
   #if ENABLED(ULTIPANEL)
76 82
 
83
+    // Function pointer to menu functions.
84
+    typedef void (*screenFunc_t)();
85
+
86
+    void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder=0);
87
+
77 88
     #define BLEN_A 0
78 89
     #define BLEN_B 1
79 90
     // Encoder click is directly connected
@@ -91,7 +102,18 @@
91 102
 
92 103
     #if ENABLED(ADVANCED_PAUSE_FEATURE)
93 104
       void lcd_advanced_pause_show_message(const AdvancedPauseMessage message);
94
-    #endif // ADVANCED_PAUSE_FEATURE
105
+    #endif
106
+
107
+    #if ENABLED(AUTO_BED_LEVELING_UBL)
108
+      void lcd_mesh_edit_setup(float initial);
109
+      float lcd_mesh_edit();
110
+      void lcd_z_offset_edit_setup(float);
111
+      float lcd_z_offset_edit();
112
+    #endif
113
+
114
+    #if ENABLED(DELTA_CALIBRATION_MENU)
115
+      float lcd_probe_pt(const float &lx, const float &ly);
116
+    #endif
95 117
 
96 118
   #else
97 119
 
@@ -189,16 +211,9 @@
189 211
 
190 212
 void lcd_reset_status();
191 213
 
192
-#if ENABLED(AUTO_BED_LEVELING_UBL)
193
-  extern bool ubl_lcd_map_control;
194
-  void lcd_mesh_edit_setup(float initial);
195
-  float lcd_mesh_edit();
196
-  void lcd_z_offset_edit_setup(float);
197
-  float lcd_z_offset_edit();
198
-#endif
199
-
200
-#if ENABLED(DELTA_CALIBRATION_MENU)
201
-  float lcd_probe_pt(const float &lx, const float &ly);
214
+// For i2c define BUZZ to use lcd_buzz
215
+#if ENABLED(LCD_USE_I2C_BUZZER)
216
+  #define BUZZ(d,f) lcd_buzz(d, f)
202 217
 #endif
203 218
 
204 219
 #endif // ULTRALCD_H

+ 31
- 32
Marlin/src/lcd/ultralcd_impl_DOGM.h View File

@@ -36,27 +36,27 @@
36 36
 #ifndef ULTRALCD_IMPL_DOGM_H
37 37
 #define ULTRALCD_IMPL_DOGM_H
38 38
 
39
-#include "MarlinConfig.h"
39
+#include "../inc/MarlinConfig.h"
40 40
 
41
-/**
42
- * Implementation of the LCD display routines for a DOGM128 graphic display.
43
- * These are common LCD 128x64 pixel graphic displays.
44
- */
45 41
 #include "ultralcd.h"
46
-#include "ultralcd_st7920_u8glib_rrd.h"
47
-#include "ultralcd_st7565_u8glib_VIKI.h"
48
-#include "dogm_bitmaps.h"
49
-#include "utility.h"
50
-#include "duration_t.h"
42
+
43
+#if ENABLED(U8GLIB_ST7565_64128N)
44
+  #include "dogm/ultralcd_st7565_u8glib_VIKI.h"
45
+#elif ENABLED(U8GLIB_ST7920)
46
+  #include "dogm/ultralcd_st7920_u8glib_rrd.h"
47
+#endif
48
+
49
+#include "dogm/dogm_bitmaps.h"
50
+#include "../libs/duration_t.h"
51 51
 
52 52
 #include <U8glib.h>
53 53
 
54 54
 #if ENABLED(AUTO_BED_LEVELING_UBL)
55
-  #include "ubl.h"
55
+  #include "../feature/ubl/ubl.h"
56 56
 #endif
57 57
 
58 58
 #if ENABLED(SHOW_BOOTSCREEN) && ENABLED(SHOW_CUSTOM_BOOTSCREEN)
59
-  #include "_Bootscreen.h"
59
+  #include "../config/_Bootscreen.h"
60 60
 #endif
61 61
 
62 62
 // Only Western languages support big / small fonts
@@ -66,57 +66,57 @@
66 66
 #endif
67 67
 
68 68
 #if ENABLED(USE_SMALL_INFOFONT)
69
-  #include "dogm_font_data_6x9_marlin.h"
69
+  #include "dogm/dogm_font_data_6x9_marlin.h"
70 70
   #define FONT_STATUSMENU_NAME u8g_font_6x9
71 71
 #else
72 72
   #define FONT_STATUSMENU_NAME FONT_MENU_NAME
73 73
 #endif
74 74
 
75
-#include "dogm_font_data_Marlin_symbols.h"   // The Marlin special symbols
75
+#include "dogm/dogm_font_data_Marlin_symbols.h"   // The Marlin special symbols
76 76
 #define FONT_SPECIAL_NAME Marlin_symbols
77 77
 
78 78
 #if DISABLED(SIMULATE_ROMFONT)
79 79
   #if ENABLED(DISPLAY_CHARSET_ISO10646_1)
80
-    #include "dogm_font_data_ISO10646_1.h"
80
+    #include "dogm/dogm_font_data_ISO10646_1.h"
81 81
     #define FONT_MENU_NAME ISO10646_1_5x7
82 82
   #elif ENABLED(DISPLAY_CHARSET_ISO10646_PL)
83
-    #include "dogm_font_data_ISO10646_1_PL.h"
83
+    #include "dogm/dogm_font_data_ISO10646_1_PL.h"
84 84
     #define FONT_MENU_NAME ISO10646_1_PL_5x7
85 85
   #elif ENABLED(DISPLAY_CHARSET_ISO10646_5)
86
-    #include "dogm_font_data_ISO10646_5_Cyrillic.h"
86
+    #include "dogm/dogm_font_data_ISO10646_5_Cyrillic.h"
87 87
     #define FONT_MENU_NAME ISO10646_5_Cyrillic_5x7
88 88
   #elif ENABLED(DISPLAY_CHARSET_ISO10646_KANA)
89
-    #include "dogm_font_data_ISO10646_Kana.h"
89
+    #include "dogm/dogm_font_data_ISO10646_Kana.h"
90 90
     #define FONT_MENU_NAME ISO10646_Kana_5x7
91 91
   #elif ENABLED(DISPLAY_CHARSET_ISO10646_GREEK)
92
-    #include "dogm_font_data_ISO10646_Greek.h"
92
+    #include "dogm/dogm_font_data_ISO10646_Greek.h"
93 93
     #define FONT_MENU_NAME ISO10646_Greek_5x7
94 94
   #elif ENABLED(DISPLAY_CHARSET_ISO10646_CN)
95
-    #include "dogm_font_data_ISO10646_CN.h"
95
+    #include "dogm/dogm_font_data_ISO10646_CN.h"
96 96
     #define FONT_MENU_NAME ISO10646_CN
97 97
     #define TALL_FONT_CORRECTION 1
98 98
   #elif ENABLED(DISPLAY_CHARSET_ISO10646_TR)
99
-    #include "dogm_font_data_ISO10646_1_tr.h"
99
+    #include "dogm/dogm_font_data_ISO10646_1_tr.h"
100 100
     #define FONT_MENU_NAME ISO10646_TR
101 101
   #elif ENABLED(DISPLAY_CHARSET_ISO10646_CZ)
102
-    #include "dogm_font_data_ISO10646_CZ.h"
102
+    #include "dogm/dogm_font_data_ISO10646_CZ.h"
103 103
     #define FONT_MENU_NAME ISO10646_CZ
104 104
   #else // fall-back
105
-    #include "dogm_font_data_ISO10646_1.h"
105
+    #include "dogm/dogm_font_data_ISO10646_1.h"
106 106
     #define FONT_MENU_NAME ISO10646_1_5x7
107 107
   #endif
108 108
 #else // SIMULATE_ROMFONT
109 109
   #if DISPLAY_CHARSET_HD44780 == JAPANESE
110
-    #include "dogm_font_data_HD44780_J.h"
110
+    #include "dogm/dogm_font_data_HD44780_J.h"
111 111
     #define FONT_MENU_NAME HD44780_J_5x7
112 112
   #elif DISPLAY_CHARSET_HD44780 == WESTERN
113
-    #include "dogm_font_data_HD44780_W.h"
113
+    #include "dogm/dogm_font_data_HD44780_W.h"
114 114
     #define FONT_MENU_NAME HD44780_W_5x7
115 115
   #elif DISPLAY_CHARSET_HD44780 == CYRILLIC
116
-    #include "dogm_font_data_HD44780_C.h"
116
+    #include "dogm/dogm_font_data_HD44780_C.h"
117 117
     #define FONT_MENU_NAME HD44780_C_5x7
118 118
   #else // fall-back
119
-    #include "dogm_font_data_ISO10646_1.h"
119
+    #include "dogm/dogm_font_data_ISO10646_1.h"
120 120
     #define FONT_MENU_NAME ISO10646_1_5x7
121 121
   #endif
122 122
 #endif // SIMULATE_ROMFONT
@@ -174,11 +174,10 @@
174 174
   U8GLIB_LM6059_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes
175 175
 #elif ENABLED(U8GLIB_ST7565_64128N)
176 176
   // The MaKrPanel, Mini Viki, and Viki 2.0, ST7565 controller 
177
-//  U8GLIB_ST7565_64128n_2x_VIKI u8g(0);  // using SW-SPI DOGLCD_MOSI != -1 && DOGLCD_SCK 
178
-    U8GLIB_ST7565_64128n_2x_VIKI u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0);  // using SW-SPI 
179
-    //U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);  // 8 stripes
180
-    //U8GLIB_NHD_C12864_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes  HWSPI
181
-  
177
+  //U8GLIB_ST7565_64128n_2x_VIKI u8g(0);  // using SW-SPI DOGLCD_MOSI != -1 && DOGLCD_SCK 
178
+  U8GLIB_ST7565_64128n_2x_VIKI u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0);  // using SW-SPI 
179
+  //U8GLIB_NHD_C12864 u8g(DOGLCD_CS, DOGLCD_A0);  // 8 stripes
180
+  //U8GLIB_NHD_C12864_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes  HWSPI
182 181
 #elif ENABLED(U8GLIB_SSD1306)
183 182
   // Generic support for SSD1306 OLED I2C LCDs
184 183
   //U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST);  // 8 stripes

+ 6
- 3
Marlin/src/lcd/ultralcd_impl_HD44780.h View File

@@ -28,11 +28,14 @@
28 28
  * These are the most common LCD character displays.
29 29
  */
30 30
 
31
-#include "utility.h"
32
-#include "duration_t.h"
31
+#include "../inc/MarlinConfig.h"
32
+
33
+#if LCD_HEIGHT > 3
34
+  #include "../libs/duration_t.h"
35
+#endif
33 36
 
34 37
 #if ENABLED(AUTO_BED_LEVELING_UBL)
35
-  #include "ubl.h"
38
+  #include "../feature/ubl/ubl.h"
36 39
 
37 40
   #if ENABLED(ULTIPANEL)
38 41
     #define ULTRA_X_PIXELS_PER_CHAR    5

+ 1
- 1
Marlin/src/lcd/utf_mapper.h View File

@@ -23,7 +23,7 @@
23 23
 #ifndef UTF_MAPPER_H
24 24
 #define UTF_MAPPER_H
25 25
 
26
-#include "language.h"
26
+#include "../inc/MarlinConfig.h"
27 27
 
28 28
 #if ENABLED(DOGLCD)
29 29
   #define HARDWARE_CHAR_OUT u8g.print

Loading…
Cancel
Save