Browse Source

Allow LCD_PIXEL_WIDTH/HEIGHT override

Scott Lahteine 4 years ago
parent
commit
b2328d089a

+ 1
- 1
Marlin/src/gcode/queue.cpp View File

@@ -532,7 +532,7 @@ void GCodeQueue::get_serial_commands() {
532 532
 
533 533
         // Reset stream state, terminate the buffer, and commit a non-empty command
534 534
         if (!process_line_done(sd_input_state, command_buffer[index_w], sd_count)) {
535
-          _commit_command(false);                     // The file was not terminated with a newline
535
+          _commit_command(false);                     // Can handle last line missing a newline terminator
536 536
           #if ENABLED(POWER_LOSS_RECOVERY)
537 537
             recovery.cmd_sdpos = card.getIndex();     // Prime for the next _commit_command
538 538
           #endif

+ 9
- 0
Marlin/src/inc/Conditionals_LCD.h View File

@@ -361,6 +361,15 @@
361 361
 #define HAS_ADC_BUTTONS      ENABLED(ADC_KEYPAD)
362 362
 #define HAS_DGUS_LCD         ANY(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY)
363 363
 
364
+#if HAS_GRAPHICAL_LCD
365
+  #ifndef LCD_PIXEL_WIDTH
366
+    #define LCD_PIXEL_WIDTH 128
367
+  #endif
368
+  #ifndef LCD_PIXEL_HEIGHT
369
+    #define LCD_PIXEL_HEIGHT 64
370
+  #endif
371
+#endif
372
+
364 373
 /**
365 374
  * Extruders have some combination of stepper motors and hotends
366 375
  * so we separate these concepts into the defines:

+ 2
- 1
Marlin/src/lcd/dogm/HAL_LCD_com_defines.h View File

@@ -25,7 +25,7 @@
25 25
 
26 26
 #include <U8glib.h>
27 27
 
28
-#ifndef U8G_HAL_LINKS
28
+#ifndef U8G_HAL_LINKS   // Defined by LPC1768/9 environments in platform.ini
29 29
 
30 30
   #ifdef __SAM3X8E__
31 31
 
@@ -75,6 +75,7 @@
75 75
     #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_arduino_st7920_hw_spi_fn
76 76
   #endif
77 77
 
78
+  // This can't be invoked from the current platformio.ini
78 79
   #ifdef TARGET_LPC1768
79 80
     uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
80 81
   #endif

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

@@ -59,8 +59,6 @@
59 59
 
60 60
 #include "HAL_LCD_com_defines.h"
61 61
 
62
-#define LCD_PIXEL_WIDTH  128
63
-#define LCD_PIXEL_HEIGHT  64
64 62
 #define PAGE_HEIGHT        8
65 63
 
66 64
 /* init sequence from https://github.com/adafruit/ST7565-LCD/blob/master/ST7565/ST7565.cpp */

+ 0
- 7
Marlin/src/lcd/dogm/ultralcd_DOGM.h View File

@@ -196,13 +196,6 @@
196 196
   #endif
197 197
 #endif
198 198
 
199
-#ifndef LCD_PIXEL_WIDTH
200
-  #define LCD_PIXEL_WIDTH 128
201
-#endif
202
-#ifndef LCD_PIXEL_HEIGHT
203
-  #define LCD_PIXEL_HEIGHT 64
204
-#endif
205
-
206 199
 // LCD_FULL_PIXEL_WIDTH =
207 200
 // LCD_PIXEL_OFFSET_X + (LCD_PIXEL_WIDTH * 2) + LCD_PIXEL_OFFSET_X
208 201
 #if ENABLED(FSMC_GRAPHICAL_TFT)

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

@@ -154,4 +154,4 @@ u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = { u8g_dev_rrd_st7920_128x64_fn, &u8
154 154
 #endif
155 155
 
156 156
 #endif // U8GLIB_ST7920
157
-#endif // __AVR__ && !U8G_HAL_LINKS
157
+#endif // !U8G_HAL_LINKS && (__AVR__ || ARDUINO_ARCH_STM32 || ARDUINO_ARCH_ESP32)

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

@@ -31,12 +31,9 @@
31 31
 #define ST7920_DAT_PIN  LCD_PINS_ENABLE
32 32
 #define ST7920_CS_PIN   LCD_PINS_RS
33 33
 
34
-//#define PAGE_HEIGHT 8   //128 byte framebuffer
35
-#define PAGE_HEIGHT 16  //256 byte framebuffer
36
-//#define PAGE_HEIGHT 32  //512 byte framebuffer
37
-
38
-#define LCD_PIXEL_WIDTH 128
39
-#define LCD_PIXEL_HEIGHT 64
34
+//#define PAGE_HEIGHT 8   // 128 byte framebuffer
35
+#define PAGE_HEIGHT 16    // 256 byte framebuffer
36
+//#define PAGE_HEIGHT 32  // 512 byte framebuffer
40 37
 
41 38
 #include <U8glib.h>
42 39
 

Loading…
Cancel
Save