Parcourir la source

LCD Size Defines (#15297)

Robby Candra il y a 5 ans
Parent
révision
787d522036

+ 7
- 6
Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp Voir le fichier

@@ -60,6 +60,7 @@
60 60
 #if HAS_GRAPHICAL_LCD && PIN_EXISTS(FSMC_CS)
61 61
 
62 62
 #include "HAL_LCD_com_defines.h"
63
+#include "ultralcd_DOGM.h"
63 64
 
64 65
 #include <string.h>
65 66
 
@@ -70,12 +71,12 @@
70 71
   extern void LCD_IO_WriteMultiple(uint16_t color, uint32_t count);
71 72
 #endif
72 73
 
73
-#define WIDTH 128
74
-#define HEIGHT 64
74
+#define WIDTH LCD_PIXEL_WIDTH
75
+#define HEIGHT LCD_PIXEL_HEIGHT
75 76
 #define PAGE_HEIGHT 8
76 77
 
77
-#define X_LO 32
78
-#define Y_LO 32
78
+#define X_LO LCD_PIXEL_OFFSET_X
79
+#define Y_LO LCD_PIXEL_OFFSET_Y
79 80
 #define X_HI (X_LO + 2 * WIDTH  - 1)
80 81
 #define Y_HI (Y_LO + 2 * HEIGHT - 1)
81 82
 
@@ -142,8 +143,8 @@ static const uint8_t page_first_sequence[] = {
142 143
 };
143 144
 
144 145
 static const uint8_t clear_screen_sequence[] = {
145
-  U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), 0x00, 0x00, 0x01, 0x3F,
146
-  U8G_ESC_ADR(0), LCD_ROW,    U8G_ESC_ADR(1), 0x00, 0x00, 0x00, 0xEF,
146
+  U8G_ESC_ADR(0), LCD_COLUMN, U8G_ESC_ADR(1), 0x00, 0x00, U8G_ESC_DATA(LCD_FULL_PIXEL_WIDTH),
147
+  U8G_ESC_ADR(0), LCD_ROW,    U8G_ESC_ADR(1), 0x00, 0x00, U8G_ESC_DATA(LCD_FULL_PIXEL_HEIGHT),
147 148
   U8G_ESC_ADR(0), LCD_WRITE_RAM, U8G_ESC_ADR(1),
148 149
   U8G_ESC_END
149 150
 };

+ 9
- 0
Marlin/src/lcd/dogm/ultralcd_DOGM.h Voir le fichier

@@ -145,6 +145,15 @@
145 145
   #define LCD_PIXEL_HEIGHT 64
146 146
 #endif
147 147
 
148
+// LCD_FULL_PIXEL_WIDTH = 
149
+// LCD_PIXEL_OFFSET_X + (LCD_PIXEL_WIDTH * 2) + LCD_PIXEL_OFFSET_X 
150
+#if ENABLED(FSMC_GRAPHICAL_TFT)
151
+  #define LCD_FULL_PIXEL_WIDTH  320
152
+  #define LCD_PIXEL_OFFSET_X    32  
153
+  #define LCD_FULL_PIXEL_HEIGHT 240
154
+  #define LCD_PIXEL_OFFSET_Y    32
155
+#endif
156
+
148 157
 // For selective rendering within a Y range
149 158
 #define PAGE_OVER(ya)         ((ya) <= u8g.getU8g()->current_page.y1) // Does the current page follow a region top?
150 159
 #define PAGE_UNDER(yb)        ((yb) >= u8g.getU8g()->current_page.y0) // Does the current page precede a region bottom?

Chargement…
Annuler
Enregistrer