Browse Source

Don't compile custom u8g without DOGLCD

Scott Lahteine 7 years ago
parent
commit
81bc428b48

+ 5
- 0
Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp View File

69
  * beginning.
69
  * beginning.
70
  */
70
  */
71
 
71
 
72
+#include "../../inc/MarlinConfig.h"
73
+
74
+#if ENABLED(DOGLCD)
75
+
72
 #include <U8glib.h>
76
 #include <U8glib.h>
73
 #include "HAL_LCD_com_defines.h"
77
 #include "HAL_LCD_com_defines.h"
74
 
78
 
308
   return 1;
312
   return 1;
309
 }
313
 }
310
 
314
 
315
+#endif // DOGLCD

+ 7
- 1
Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp View File

57
 
57
 
58
 */
58
 */
59
 
59
 
60
+#include "../../inc/MarlinConfig.h"
61
+
62
+#if ENABLED(DOGLCD)
63
+
60
 #include <U8glib.h>
64
 #include <U8glib.h>
61
 
65
 
62
 #include "HAL_LCD_com_defines.h"
66
 #include "HAL_LCD_com_defines.h"
226
 
230
 
227
 
231
 
228
 U8G_PB_DEV(u8g_dev_st7565_64128n_HAL_hw_spi, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_st7565_64128n_HAL_fn, U8G_COM_HAL_HW_SPI_FN);
232
 U8G_PB_DEV(u8g_dev_st7565_64128n_HAL_hw_spi, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_st7565_64128n_HAL_fn, U8G_COM_HAL_HW_SPI_FN);
229
-u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_hw_spi = { u8g_dev_st7565_64128n_HAL_2x_fn, &u8g_dev_st7565_64128n_HAL_2x_pb, U8G_COM_HAL_HW_SPI_FN };
233
+u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_hw_spi = { u8g_dev_st7565_64128n_HAL_2x_fn, &u8g_dev_st7565_64128n_HAL_2x_pb, U8G_COM_HAL_HW_SPI_FN };
234
+
235
+#endif // DOGLCD

+ 6
- 0
Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp View File

56
 
56
 
57
 */
57
 */
58
 
58
 
59
+#include "../../inc/MarlinConfig.h"
60
+
61
+#if ENABLED(DOGLCD)
62
+
59
 #include <U8glib.h>
63
 #include <U8glib.h>
60
 
64
 
61
 #include "HAL_LCD_com_defines.h"
65
 #include "HAL_LCD_com_defines.h"
200
   // for the ST7920 for HAL systems no matter what is selected in ultralcd_impl_DOGM.h.
204
   // for the ST7920 for HAL systems no matter what is selected in ultralcd_impl_DOGM.h.
201
   u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = { u8g_dev_st7920_128x64_HAL_4x_fn, &u8g_dev_st7920_128x64_HAL_4x_pb, U8G_COM_ST7920_HAL_SW_SPI };
205
   u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = { u8g_dev_st7920_128x64_HAL_4x_fn, &u8g_dev_st7920_128x64_HAL_4x_pb, U8G_COM_ST7920_HAL_SW_SPI };
202
 #endif
206
 #endif
207
+
208
+#endif // DOGLCD

+ 12
- 12
Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp View File

23
 // NOTE - the HAL version of the rrd device uses a generic ST7920 device.  See the
23
 // NOTE - the HAL version of the rrd device uses a generic ST7920 device.  See the
24
 // file u8g_dev_st7920_128x64_HAL.cpp for the HAL version.
24
 // file u8g_dev_st7920_128x64_HAL.cpp for the HAL version.
25
 
25
 
26
+#include "../../inc/MarlinConfig.h"
27
+
28
+#if ENABLED(DOGLCD)
29
+
26
 #ifndef U8G_HAL_LINKS
30
 #ifndef U8G_HAL_LINKS
27
 
31
 
28
-#include "../../Marlin.h"
32
+//#include "../../Marlin.h"
29
 
33
 
30
 //#if ENABLED(U8GLIB_ST7920)
34
 //#if ENABLED(U8GLIB_ST7920)
31
 //#if ( ENABLED(SHARED_SPI) || !ENABLED(SHARED_SPI) && (defined(LCD_PINS_D4) &&  LCD_PINS_D4 >= 0) &&  (defined(LCD_PINS_ENABLE) &&  LCD_PINS_ENABLE >= 0))
35
 //#if ( ENABLED(SHARED_SPI) || !ENABLED(SHARED_SPI) && (defined(LCD_PINS_D4) &&  LCD_PINS_D4 >= 0) &&  (defined(LCD_PINS_ENABLE) &&  LCD_PINS_ENABLE >= 0))
97
   #define U8G_DELAY() u8g_10MicroDelay()
101
   #define U8G_DELAY() u8g_10MicroDelay()
98
 #endif
102
 #endif
99
 
103
 
100
-
101
-
102
 static void ST7920_WRITE_BYTE(uint8_t val) {
104
 static void ST7920_WRITE_BYTE(uint8_t val) {
103
   for (uint8_t i = 0; i < 8; i++) {
105
   for (uint8_t i = 0; i < 8; i++) {
104
     WRITE(ST7920_DAT_PIN, val & 0x80);
106
     WRITE(ST7920_DAT_PIN, val & 0x80);
105
     WRITE(ST7920_CLK_PIN, HIGH);
107
     WRITE(ST7920_CLK_PIN, HIGH);
106
     WRITE(ST7920_CLK_PIN, LOW);
108
     WRITE(ST7920_CLK_PIN, LOW);
107
-    val = val << 1;
109
+    val <<= 1;
108
   }
110
   }
109
 }
111
 }
110
 
112
 
111
-
112
 #define ST7920_SET_CMD()         { ST7920_WRITE_BYTE(0xF8); U8G_DELAY(); }
113
 #define ST7920_SET_CMD()         { ST7920_WRITE_BYTE(0xF8); U8G_DELAY(); }
113
 #define ST7920_SET_DAT()         { ST7920_WRITE_BYTE(0xFA); U8G_DELAY(); }
114
 #define ST7920_SET_DAT()         { ST7920_WRITE_BYTE(0xFA); U8G_DELAY(); }
114
 #define ST7920_WRITE_NIBBLES(a)     { ST7920_WRITE_BYTE((uint8_t)((a)&0xF0u)); ST7920_WRITE_BYTE((uint8_t)((a)<<4u)); U8G_DELAY(); }
115
 #define ST7920_WRITE_NIBBLES(a)     { ST7920_WRITE_BYTE((uint8_t)((a)&0xF0u)); ST7920_WRITE_BYTE((uint8_t)((a)<<4u)); U8G_DELAY(); }
118
 #define ST7920_CS()              { WRITE(ST7920_CS_PIN,1); U8G_DELAY(); }
119
 #define ST7920_CS()              { WRITE(ST7920_CS_PIN,1); U8G_DELAY(); }
119
 #define ST7920_NCS()             { WRITE(ST7920_CS_PIN,0); }
120
 #define ST7920_NCS()             { WRITE(ST7920_CS_PIN,0); }
120
 
121
 
121
-
122
-
123
 uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) {
122
 uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) {
124
   uint8_t i, y;
123
   uint8_t i, y;
125
   switch (msg) {
124
   switch (msg) {
126
     case U8G_DEV_MSG_INIT: {
125
     case U8G_DEV_MSG_INIT: {
127
       OUT_WRITE(ST7920_CS_PIN, LOW);
126
       OUT_WRITE(ST7920_CS_PIN, LOW);
128
-
129
-
130
-        OUT_WRITE(ST7920_DAT_PIN, LOW);
131
-        OUT_WRITE(ST7920_CLK_PIN, LOW);
127
+      OUT_WRITE(ST7920_DAT_PIN, LOW);
128
+      OUT_WRITE(ST7920_CLK_PIN, LOW);
132
 
129
 
133
       ST7920_CS();
130
       ST7920_CS();
134
       u8g_Delay(120);                 //initial delay for boot up
131
       u8g_Delay(120);                 //initial delay for boot up
197
 
194
 
198
 //#endif //( ENABLED(SHARED_SPI) || !ENABLED(SHARED_SPI) && (defined(LCD_PINS_D4) &&  LCD_PINS_D4 >= 0) &&  (defined(LCD_PINS_ENABLE) &&  LCD_PINS_ENABLE >= 0))
195
 //#endif //( ENABLED(SHARED_SPI) || !ENABLED(SHARED_SPI) && (defined(LCD_PINS_D4) &&  LCD_PINS_D4 >= 0) &&  (defined(LCD_PINS_ENABLE) &&  LCD_PINS_ENABLE >= 0))
199
 //#endif // U8GLIB_ST7920
196
 //#endif // U8GLIB_ST7920
200
-#endif // AVR
197
+
198
+#endif // U8G_HAL_LINKS
199
+
200
+#endif // DOGLCD

Loading…
Cancel
Save