Просмотр исходного кода

Move scaled TFT / touch defines (#18915)

Scott Lahteine 4 лет назад
Родитель
Сommit
ca0ebf10d1
Аккаунт пользователя с таким Email не найден

+ 2
- 2
Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_hwspi.cpp Просмотреть файл

@@ -20,7 +20,7 @@
20 20
 
21 21
 #include "../../../inc/MarlinConfig.h"
22 22
 
23
-#if BOTH(HAS_GRAPHICAL_LCD, SPI_GRAPHICAL_TFT) && DISABLED(FORCE_SOFT_SPI)
23
+#if ENABLED(SPI_GRAPHICAL_TFT) && DISABLED(FORCE_SOFT_SPI)
24 24
 
25 25
 #include "../HAL.h"
26 26
 #include <U8glib.h>
@@ -232,5 +232,5 @@ uint8_t u8g_com_stm32duino_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void
232 232
   return 1;
233 233
 }
234 234
 
235
-#endif // HAS_GRAPHICAL_LCD
235
+#endif // SPI_GRAPHICAL_TFT && !FORCE_SOFT_SPI
236 236
 #endif // STM32F1

+ 19
- 12
Marlin/src/MarlinCore.cpp Просмотреть файл

@@ -39,26 +39,27 @@
39 39
 #include <math.h>
40 40
 
41 41
 #include "core/utility.h"
42
-#include "lcd/ultralcd.h"
43 42
 #include "module/motion.h"
44 43
 #include "module/planner.h"
45
-#include "module/stepper.h"
46 44
 #include "module/endstops.h"
47
-#include "module/probe.h"
48 45
 #include "module/temperature.h"
49
-#include "sd/cardreader.h"
50 46
 #include "module/configuration_store.h"
51 47
 #include "module/printcounter.h" // PrintCounter or Stopwatch
52
-#include "feature/closedloop.h"
53 48
 
49
+#include "module/stepper.h"
54 50
 #include "module/stepper/indirection.h"
55 51
 
56
-#include "libs/nozzle.h"
57
-
58 52
 #include "gcode/gcode.h"
59 53
 #include "gcode/parser.h"
60 54
 #include "gcode/queue.h"
61 55
 
56
+#include "sd/cardreader.h"
57
+
58
+#include "lcd/ultralcd.h"
59
+#if HAS_TOUCH_XPT2046
60
+  #include "lcd/touch/xpt2046.h"
61
+#endif
62
+
62 63
 #if HAS_TFT_LVGL_UI
63 64
   #include "lcd/extui/lib/mks_ui/tft_lvgl_configuration.h"
64 65
   #include "lcd/extui/lib/mks_ui/draw_ui.h"
@@ -80,10 +81,6 @@
80 81
   #include "feature/direct_stepping.h"
81 82
 #endif
82 83
 
83
-#if HAS_TOUCH_XPT2046
84
-  #include "feature/touch/xpt2046.h"
85
-#endif
86
-
87 84
 #if ENABLED(HOST_ACTION_COMMANDS)
88 85
   #include "feature/host_actions.h"
89 86
 #endif
@@ -92,6 +89,10 @@
92 89
   #include "libs/buzzer.h"
93 90
 #endif
94 91
 
92
+#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER)
93
+  #include "feature/closedloop.h"
94
+#endif
95
+
95 96
 #if HAS_I2C_DIGIPOT
96 97
   #include "feature/digipot/digipot.h"
97 98
 #endif
@@ -176,6 +177,10 @@
176 177
   #include "feature/runout.h"
177 178
 #endif
178 179
 
180
+#if HAS_Z_SERVO_PROBE
181
+  #include "module/probe.h"
182
+#endif
183
+
179 184
 #if ENABLED(HOTEND_IDLE_TIMEOUT)
180 185
   #include "feature/hotend_idle.h"
181 186
 #endif
@@ -1194,7 +1199,9 @@ void setup() {
1194 1199
   #endif
1195 1200
 
1196 1201
   #if HAS_TFT_LVGL_UI
1197
-    if (!card.isMounted()) SETUP_RUN(card.mount()); // Mount SD to load graphics and fonts
1202
+    #if ENABLED(SDSUPPORT)
1203
+      if (!card.isMounted()) SETUP_RUN(card.mount()); // Mount SD to load graphics and fonts
1204
+    #endif
1198 1205
     SETUP_RUN(tft_lvgl_init());
1199 1206
   #endif
1200 1207
 

+ 64
- 65
Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp Просмотреть файл

@@ -20,40 +20,39 @@
20 20
  *
21 21
  */
22 22
 
23
-/*
24
-
25
-  u8g_dev_tft_320x240_upscale_from_128x64.cpp
26
-
27
-  Universal 8bit Graphics Library
28
-
29
-  Copyright (c) 2011, olikraus@gmail.com
30
-  All rights reserved.
31
-
32
-  Redistribution and use in source and binary forms, with or without modification,
33
-  are permitted provided that the following conditions are met:
34
-
35
-  * Redistributions of source code must retain the above copyright notice, this list
36
-    of conditions and the following disclaimer.
37
-
38
-  * Redistributions in binary form must reproduce the above copyright notice, this
39
-    list of conditions and the following disclaimer in the documentation and/or other
40
-    materials provided with the distribution.
41
-
42
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
43
-  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
44
-  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
45
-  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
46
-  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
47
-  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48
-  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
49
-  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
50
-  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
51
-  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
52
-  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
53
-  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
54
-  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55
-
56
-*/
23
+/**
24
+ * u8g_dev_tft_320x240_upscale_from_128x64.cpp
25
+ *
26
+ * Universal 8bit Graphics Library
27
+ *
28
+ * Copyright (c) 2011, olikraus@gmail.com
29
+ * All rights reserved.
30
+ *
31
+ * Redistribution and use in source and binary forms, with or without modification,
32
+ * are permitted provided that the following conditions are met:
33
+ *
34
+ * Redistributions of source code must retain the above copyright notice, this list
35
+ * of conditions and the following disclaimer.
36
+ *
37
+ * Redistributions in binary form must reproduce the above copyright notice, this
38
+ * list of conditions and the following disclaimer in the documentation and/or other
39
+ * materials provided with the distribution.
40
+ *
41
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
42
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
43
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
44
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
45
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
46
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
48
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
49
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
50
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
51
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
52
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
53
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54
+ *
55
+ */
57 56
 
58 57
 #include "../../inc/MarlinConfig.h"
59 58
 
@@ -80,14 +79,16 @@
80 79
   extern void LCD_IO_WriteMultiple(uint16_t color, uint32_t count);
81 80
 #endif
82 81
 
83
-#define WIDTH LCD_PIXEL_WIDTH
82
+#define WIDTH  LCD_PIXEL_WIDTH
84 83
 #define HEIGHT LCD_PIXEL_HEIGHT
85 84
 #define PAGE_HEIGHT 8
86 85
 
87
-#define X_LO LCD_PIXEL_OFFSET_X
88
-#define Y_LO LCD_PIXEL_OFFSET_Y
89
-#define X_HI (X_LO + (FSMC_UPSCALE) * WIDTH  - 1)
90
-#define Y_HI (Y_LO + (FSMC_UPSCALE) * HEIGHT - 1)
86
+#include "../scaled_tft.h"
87
+
88
+#define UPSCALE0(M) ((M) * (FSMC_UPSCALE))
89
+#define UPSCALE(A,M) (UPSCALE0(M) + (A))
90
+#define X_HI (UPSCALE(LCD_PIXEL_OFFSET_X, WIDTH) - 1)
91
+#define Y_HI (UPSCALE(LCD_PIXEL_OFFSET_Y, HEIGHT) - 1)
91 92
 
92 93
 // see https://ee-programming-notepad.blogspot.com/2016/10/16-bit-color-generator-picker.html
93 94
 
@@ -153,7 +154,6 @@ static uint32_t lcd_id = 0;
153 154
 #define ILI9328_VASTART     0x52   /* Vertical address start position (0-511) */
154 155
 #define ILI9328_VAEND       0x53   /* Vertical address end position (0-511) */
155 156
 
156
-
157 157
 static void setWindow_ili9328(u8g_t *u8g, u8g_dev_t *dev, uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) {
158 158
   #if HAS_LCD_IO
159 159
     #define IO_REG_DATA(R,D) do { LCD_IO_WriteReg(R); LCD_IO_WriteData(D); }while(0)
@@ -216,7 +216,6 @@ static void setWindow_st7789v(u8g_t *u8g, u8g_dev_t *dev, uint16_t Xmin, uint16_
216 216
 static void setWindow_none(u8g_t *u8g, u8g_dev_t *dev, uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) {}
217 217
 void (*setWindow)(u8g_t *u8g, u8g_dev_t *dev, uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) = setWindow_none;
218 218
 
219
-
220 219
 #define ESC_REG(x)      0xFFFF, 0x00FF & (uint16_t)x
221 220
 #define ESC_DELAY(x)    0xFFFF, 0x8000 | (x & 0x7FFF)
222 221
 #define ESC_END         0xFFFF, 0x7FFF
@@ -552,20 +551,20 @@ static const uint16_t st9677_init[] = {
552 551
   #define BUTTON_SIZE_Y 20
553 552
 
554 553
   // 14, 90, 166, 242, 185 are the original values upscaled 2x.
555
-  #define BUTTOND_X_LO (14 / 2) * (FSMC_UPSCALE)
556
-  #define BUTTOND_X_HI (BUTTOND_X_LO + (FSMC_UPSCALE) * BUTTON_SIZE_X - 1)
554
+  #define BUTTOND_X_LO UPSCALE0(14 / 2)
555
+  #define BUTTOND_X_HI (UPSCALE(BUTTOND_X_LO, BUTTON_SIZE_X) - 1)
557 556
 
558
-  #define BUTTONA_X_LO (90 / 2) * (FSMC_UPSCALE)
559
-  #define BUTTONA_X_HI (BUTTONA_X_LO + (FSMC_UPSCALE) * BUTTON_SIZE_X - 1)
557
+  #define BUTTONA_X_LO UPSCALE0(90 / 2)
558
+  #define BUTTONA_X_HI (UPSCALE(BUTTONA_X_LO, BUTTON_SIZE_X) - 1)
560 559
 
561
-  #define BUTTONB_X_LO (166 / 2) * (FSMC_UPSCALE)
562
-  #define BUTTONB_X_HI (BUTTONB_X_LO + (FSMC_UPSCALE) * BUTTON_SIZE_X - 1)
560
+  #define BUTTONB_X_LO UPSCALE0(166 / 2)
561
+  #define BUTTONB_X_HI (UPSCALE(BUTTONB_X_LO, BUTTON_SIZE_X) - 1)
563 562
 
564
-  #define BUTTONC_X_LO (242 / 2) * (FSMC_UPSCALE)
565
-  #define BUTTONC_X_HI (BUTTONC_X_LO + (FSMC_UPSCALE) * BUTTON_SIZE_X - 1)
563
+  #define BUTTONC_X_LO UPSCALE0(242 / 2)
564
+  #define BUTTONC_X_HI (UPSCALE(BUTTONC_X_LO, BUTTON_SIZE_X) - 1)
566 565
 
567
-  #define BUTTON_Y_LO (140 / 2) * (FSMC_UPSCALE) + 44 //184 2x, 254 3x
568
-  #define BUTTON_Y_HI (BUTTON_Y_LO + (FSMC_UPSCALE) * BUTTON_SIZE_Y - 1)
566
+  #define BUTTON_Y_LO UPSCALE0(140 / 2) + 44 // 184 2x, 254 3x
567
+  #define BUTTON_Y_HI (UPSCALE(BUTTON_Y_LO, BUTTON_SIZE_Y) - 1)
569 568
 
570 569
   void drawImage(const uint8_t *data, u8g_t *u8g, u8g_dev_t *dev, uint16_t length, uint16_t height, uint16_t color) {
571 570
     uint16_t buffer[BUTTON_SIZE_X * sq(FSMC_UPSCALE)];
@@ -584,8 +583,8 @@ static const uint16_t st9677_init[] = {
584 583
       }
585 584
       #if HAS_LCD_IO
586 585
         LOOP_S_L_N(n, 1, FSMC_UPSCALE)
587
-          for (uint16_t l = 0; l < length * (FSMC_UPSCALE); l++)
588
-            buffer[l + (length * (FSMC_UPSCALE) * n)] = buffer[l];
586
+          for (uint16_t l = 0; l < UPSCALE0(length); l++)
587
+            buffer[l + n * UPSCALE0(length)] = buffer[l];
589 588
 
590 589
         LCD_IO_WriteSequence(buffer, length * sq(FSMC_UPSCALE));
591 590
       #else
@@ -660,27 +659,27 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u
660 659
       }
661 660
 
662 661
       // Clear Screen
663
-      setWindow(u8g, dev, 0, 0, LCD_FULL_PIXEL_WIDTH - 1, LCD_FULL_PIXEL_HEIGHT - 1);
662
+      setWindow(u8g, dev, 0, 0, (LCD_FULL_PIXEL_WIDTH) - 1, (LCD_FULL_PIXEL_HEIGHT) - 1);
664 663
       #if HAS_LCD_IO
665
-        LCD_IO_WriteMultiple(TFT_MARLINBG_COLOR, LCD_FULL_PIXEL_WIDTH * LCD_FULL_PIXEL_HEIGHT);
664
+        LCD_IO_WriteMultiple(TFT_MARLINBG_COLOR, (LCD_FULL_PIXEL_WIDTH) * (LCD_FULL_PIXEL_HEIGHT));
666 665
       #else
667
-        memset2(buffer, TFT_MARLINBG_COLOR, 160);
668
-        for (uint16_t i = 0; i < 960; i++)
669
-          u8g_WriteSequence(u8g, dev, 160, (uint8_t *)buffer);
666
+        memset2(buffer, TFT_MARLINBG_COLOR, (LCD_FULL_PIXEL_WIDTH) / 2);
667
+        for (uint16_t i = 0; i < (LCD_FULL_PIXEL_WIDTH) * 3; i++)
668
+          u8g_WriteSequence(u8g, dev, (LCD_FULL_PIXEL_WIDTH) / 2, (uint8_t *)buffer);
670 669
       #endif
671 670
 
672 671
       // Bottom buttons
673 672
       #if HAS_TOUCH_XPT2046
674
-        setWindow(u8g, dev, BUTTOND_X_LO, BUTTON_Y_LO,  BUTTOND_X_HI, BUTTON_Y_HI);
673
+        setWindow(u8g, dev, BUTTOND_X_LO, BUTTON_Y_LO, BUTTOND_X_HI, BUTTON_Y_HI);
675 674
         drawImage(buttonD, u8g, dev, 32, 20, TFT_BTCANCEL_COLOR);
676 675
 
677
-        setWindow(u8g, dev, BUTTONA_X_LO, BUTTON_Y_LO,  BUTTONA_X_HI, BUTTON_Y_HI);
676
+        setWindow(u8g, dev, BUTTONA_X_LO, BUTTON_Y_LO, BUTTONA_X_HI, BUTTON_Y_HI);
678 677
         drawImage(buttonA, u8g, dev, 32, 20, TFT_BTARROWS_COLOR);
679 678
 
680
-        setWindow(u8g, dev, BUTTONB_X_LO, BUTTON_Y_LO,  BUTTONB_X_HI, BUTTON_Y_HI);
679
+        setWindow(u8g, dev, BUTTONB_X_LO, BUTTON_Y_LO, BUTTONB_X_HI, BUTTON_Y_HI);
681 680
         drawImage(buttonB, u8g, dev, 32, 20, TFT_BTARROWS_COLOR);
682 681
 
683
-        setWindow(u8g, dev, BUTTONC_X_LO, BUTTON_Y_LO,  BUTTONC_X_HI, BUTTON_Y_HI);
682
+        setWindow(u8g, dev, BUTTONC_X_LO, BUTTON_Y_LO, BUTTONC_X_HI, BUTTON_Y_HI);
684 683
         drawImage(buttonC, u8g, dev, 32, 20, TFT_BTOKMENU_COLOR);
685 684
       #endif // HAS_TOUCH_XPT2046
686 685
 
@@ -690,7 +689,7 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u
690 689
 
691 690
     case U8G_DEV_MSG_PAGE_FIRST:
692 691
       page = 0;
693
-      setWindow(u8g, dev, X_LO, Y_LO, X_HI, Y_HI);
692
+      setWindow(u8g, dev, LCD_PIXEL_OFFSET_X, LCD_PIXEL_OFFSET_Y, X_HI, Y_HI);
694 693
       break;
695 694
 
696 695
     case U8G_DEV_MSG_PAGE_NEXT:
@@ -708,8 +707,8 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u
708 707
         }
709 708
         #if HAS_LCD_IO
710 709
           LOOP_S_L_N(n, 1, FSMC_UPSCALE)
711
-            for (uint16_t l = 0; l < WIDTH * (FSMC_UPSCALE); l++)
712
-              buffer[l + WIDTH * (FSMC_UPSCALE) * n] = buffer[l];
710
+            for (uint16_t l = 0; l < UPSCALE0(WIDTH); l++)
711
+              buffer[l + n * UPSCALE0(WIDTH)] = buffer[l];
713 712
 
714 713
           if (allow_async) {
715 714
             if (y > 0 || page > 1) LCD_IO_WaitSequence_Async();

+ 0
- 21
Marlin/src/lcd/dogm/ultralcd_DOGM.h Просмотреть файл

@@ -212,30 +212,9 @@
212 212
   #endif
213 213
 #endif
214 214
 
215
-// LCD_FULL_PIXEL_WIDTH =
216
-// LCD_PIXEL_OFFSET_X + (LCD_PIXEL_WIDTH * 2) + LCD_PIXEL_OFFSET_X
217
-#if TFT_SCALED_DOGLCD
218
-  #ifndef LCD_FULL_PIXEL_WIDTH
219
-    #define LCD_FULL_PIXEL_WIDTH  320
220
-  #endif
221
-  #ifndef LCD_PIXEL_OFFSET_X
222
-    #define LCD_PIXEL_OFFSET_X     32
223
-  #endif
224
-  #ifndef LCD_FULL_PIXEL_HEIGHT
225
-    #define LCD_FULL_PIXEL_HEIGHT 240
226
-  #endif
227
-  #ifndef LCD_PIXEL_OFFSET_Y
228
-    #define LCD_PIXEL_OFFSET_Y     32
229
-  #endif
230
-#endif
231
-
232 215
 // For selective rendering within a Y range
233 216
 #define PAGE_OVER(ya)         ((ya) <= u8g.getU8g()->current_page.y1) // Does the current page follow a region top?
234 217
 #define PAGE_UNDER(yb)        ((yb) >= u8g.getU8g()->current_page.y0) // Does the current page precede a region bottom?
235 218
 #define PAGE_CONTAINS(ya, yb) ((yb) >= u8g.getU8g()->current_page.y0 && (ya) <= u8g.getU8g()->current_page.y1) // Do two vertical regions overlap?
236 219
 
237
-#ifndef FSMC_UPSCALE
238
-  #define FSMC_UPSCALE 2
239
-#endif
240
-
241 220
 extern U8G_CLASS u8g;

+ 2
- 1
Marlin/src/lcd/extui/lib/mks_ui/mks_hardware_test.cpp Просмотреть файл

@@ -35,9 +35,10 @@
35 35
 #include "pic_manager.h"
36 36
 #include <lvgl.h>
37 37
 
38
+#include "../../../touch/xpt2046.h"
39
+
38 40
 #include "../../../../MarlinCore.h"
39 41
 #include "../../../../module/temperature.h"
40
-#include "../../../../feature/touch/xpt2046.h"
41 42
 #include "../../../../sd/cardreader.h"
42 43
 
43 44
 uint8_t pw_det_sta, pw_off_sta, mt_det_sta, mt_det2_sta, mt_det3_sta;

+ 24
- 16
Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp Просмотреть файл

@@ -41,8 +41,11 @@
41 41
 #include "draw_ui.h"
42 42
 #include <lvgl.h>
43 43
 
44
-#include "../../../../MarlinCore.h"
45
-#include "../../../../feature/touch/xpt2046.h"
44
+#include "../../../../inc/MarlinConfig.h"
45
+
46
+#if HAS_TOUCH_XPT2046
47
+  #include "../../../touch/xpt2046.h"
48
+#endif
46 49
 
47 50
 #if ENABLED(POWER_LOSS_RECOVERY)
48 51
   #include "../../../../feature/powerloss.h"
@@ -50,6 +53,13 @@
50 53
 
51 54
 #include <SPI.h>
52 55
 
56
+#ifndef LCD_FULL_PIXEL_WIDTH
57
+  #define LCD_FULL_PIXEL_WIDTH  480
58
+#endif
59
+#ifndef LCD_FULL_PIXEL_HEIGHT
60
+  #define LCD_FULL_PIXEL_HEIGHT 320
61
+#endif
62
+
53 63
 #if HAS_SPI_FLASH_FONT
54 64
   extern void init_gb2312_font();
55 65
 #endif
@@ -127,9 +137,8 @@ void LCD_WriteRAM_Prepare(void) {
127 137
 
128 138
 void tft_set_point(uint16_t x, uint16_t y, uint16_t point) {
129 139
   //if (DeviceCode == 0x9488) {
130
-  if ((x > 480) || (y > 320)) return;
140
+  if (x > (LCD_FULL_PIXEL_WIDTH) || y > (LCD_FULL_PIXEL_HEIGHT)) return;
131 141
   //}
132
-  //**if ( (x>320)||(y>240) ) return;
133 142
   tft_set_cursor(x, y);
134 143
 
135 144
   LCD_WriteRAM_Prepare();
@@ -187,10 +196,10 @@ void ili9320_SetWindows(uint16_t StartX, uint16_t StartY, uint16_t width, uint16
187 196
      LCD_WriteReg(0x0052, StartY);
188 197
      LCD_WriteReg(0x0051, xEnd);
189 198
      LCD_WriteReg(0x0053, yEnd);*/
190
-    LCD_WriteReg(0x0050, StartY);      //Specify the start/end positions of the window address in the horizontal direction by an address unit
191
-    LCD_WriteReg(0x0051, yEnd);      //Specify the start positions of the window address in the vertical direction by an address unit
199
+    LCD_WriteReg(0x0050, StartY);   // Specify the start/end positions of the window address in the horizontal direction by an address unit
200
+    LCD_WriteReg(0x0051, yEnd);     // Specify the start positions of the window address in the vertical direction by an address unit
192 201
     LCD_WriteReg(0x0052, 320 - xEnd);
193
-    LCD_WriteReg(0x0053, 320 - StartX - 1);      //Specify the end positions of the window address in the vertical direction by an address unit
202
+    LCD_WriteReg(0x0053, 320 - StartX - 1); // Specify the end positions of the window address in the vertical direction by an address unit
194 203
 
195 204
   }
196 205
   else {
@@ -224,16 +233,16 @@ void LCD_Clear(uint16_t Color) {
224 233
 
225 234
   if (DeviceCode == 0x9488) {
226 235
     tft_set_cursor(0, 0);
227
-    ili9320_SetWindows(0, 0, 480, 320);
236
+    ili9320_SetWindows(0, 0, LCD_FULL_PIXEL_WIDTH, LCD_FULL_PIXEL_HEIGHT);
228 237
     LCD_WriteRAM_Prepare();
229 238
     #ifdef LCD_USE_DMA_FSMC
230
-      LCD_IO_WriteMultiple(Color, LCD_FULL_PIXEL_WIDTH * LCD_FULL_PIXEL_HEIGHT);
239
+      LCD_IO_WriteMultiple(Color, (LCD_FULL_PIXEL_WIDTH) * (LCD_FULL_PIXEL_HEIGHT));
231 240
     #else
232
-    //index = (160*480);
233
-    for (index = 0; index < 320 * 480; index++)
234
-      LCD_IO_WriteData(Color);
241
+      //index = (LCD_FULL_PIXEL_HEIGHT) / 2 * (LCD_FULL_PIXEL_WIDTH);
242
+      for (index = 0; index < (LCD_FULL_PIXEL_HEIGHT) * (LCD_FULL_PIXEL_WIDTH); index++)
243
+        LCD_IO_WriteData(Color);
235 244
     #endif
236
-    //LCD_IO_WriteMultiple(Color, (480*320));
245
+    //LCD_IO_WriteMultiple(Color, (LCD_FULL_PIXEL_WIDTH) * (LCD_FULL_PIXEL_HEIGHT));
237 246
     //while(index --) LCD_IO_WriteData(Color);
238 247
   }
239 248
   else if (DeviceCode == 0x5761) {
@@ -262,7 +271,6 @@ void LCD_Clear(uint16_t Color) {
262 271
 
263 272
 extern uint16_t ILI9488_ReadRAM();
264 273
 
265
-
266 274
 void init_tft() {
267 275
   uint16_t i;
268 276
   //************* Start Initial Sequence **********//
@@ -393,7 +401,7 @@ void init_tft() {
393 401
     for (i = 0; i < 65535; i++);
394 402
     LCD_IO_WriteReg(0x0029);
395 403
 
396
-    ili9320_SetWindows(0, 0, 480, 320);
404
+    ili9320_SetWindows(0, 0, LCD_FULL_PIXEL_WIDTH, LCD_FULL_PIXEL_HEIGHT);
397 405
     LCD_Clear(0x0000);
398 406
 
399 407
     OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH);
@@ -486,7 +494,7 @@ void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * co
486 494
   #if ENABLED(TFT_LVGL_UI_SPI)
487 495
     uint16_t i, width, height;
488 496
     uint16_t clr_temp;
489
-    uint8_t tbuf[480 * 2];
497
+    uint8_t tbuf[(LCD_FULL_PIXEL_WIDTH) * 2];
490 498
 
491 499
     SPI_TFT.spi_init(SPI_FULL_SPEED);
492 500
 

+ 22
- 0
Marlin/src/lcd/lcdprint.h Просмотреть файл

@@ -1,4 +1,26 @@
1 1
 /**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
2 24
  * @file    lcdprint.h
3 25
  * @brief   LCD print api
4 26
  * @author  Yunhui Fu (yhfudev@gmail.com)

+ 50
- 0
Marlin/src/lcd/scaled_tft.h Просмотреть файл

@@ -0,0 +1,50 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#include "../inc/MarlinConfig.h"
25
+
26
+#ifndef FSMC_UPSCALE
27
+  #define FSMC_UPSCALE 2
28
+#endif
29
+
30
+#ifndef LCD_FULL_PIXEL_WIDTH
31
+  #if FSMC_UPSCALE == 3
32
+    #define LCD_FULL_PIXEL_WIDTH 480
33
+  #else
34
+    #define LCD_FULL_PIXEL_WIDTH 320
35
+  #endif
36
+#endif
37
+#ifndef LCD_FULL_PIXEL_HEIGHT
38
+  #if FSMC_UPSCALE == 3
39
+    #define LCD_FULL_PIXEL_HEIGHT 320
40
+  #else
41
+    #define LCD_FULL_PIXEL_HEIGHT 240
42
+  #endif
43
+#endif
44
+
45
+#ifndef LCD_PIXEL_OFFSET_X
46
+  #define LCD_PIXEL_OFFSET_X 48
47
+#endif
48
+#ifndef LCD_PIXEL_OFFSET_Y
49
+  #define LCD_PIXEL_OFFSET_Y 48
50
+#endif

Marlin/src/feature/touch/xpt2046.cpp → Marlin/src/lcd/touch/xpt2046.cpp Просмотреть файл

@@ -21,11 +21,8 @@
21 21
 
22 22
 #if HAS_TOUCH_XPT2046
23 23
 
24
-#if TFT_SCALED_DOGLCD
25
-  #include "../../lcd/dogm/ultralcd_DOGM.h" // for LCD_FULL_PIXEL_WIDTH, etc.
26
-#endif
27
-
28 24
 #include "xpt2046.h"
25
+#include "../scaled_tft.h"
29 26
 
30 27
 #ifndef XPT2046_Z1_THRESHOLD
31 28
   #define XPT2046_Z1_THRESHOLD 10
@@ -35,12 +32,12 @@
35 32
  * Draw and Touch processing
36 33
  *
37 34
  *      LCD_PIXEL_WIDTH/HEIGHT (128x64) is the (emulated DOGM) Pixel Drawing resolution.
38
- *   TOUCH_SCREEN_WIDTH/HEIGHT (320x240) is the Touch Area resolution.
35
+ *   TOUCH_SENSOR_WIDTH/HEIGHT (320x240) is the Touch Area resolution.
39 36
  * LCD_FULL_PIXEL_WIDTH/HEIGHT (320x240 or 480x320) is the Actual (FSMC) Display resolution.
40 37
  *
41 38
  *  - All native (u8g) drawing is done in LCD_PIXEL_* (128x64)
42 39
  *  - The DOGM pixels are is upscaled 2-3x (as needed) for display.
43
- *  - Touch coordinates use TOUCH_SCREEN_* resolution and are converted to
40
+ *  - Touch coordinates use TOUCH_SENSOR_* resolution and are converted to
44 41
  *    click and scroll-wheel events (emulating of a common DOGM display).
45 42
  *
46 43
  *  TOUCH_SCREEN resolution exists to fit our calibration values. The original touch code was made
@@ -54,21 +51,25 @@
54 51
  * The Marlin screen touchable area starts at LCD_PIXEL_OFFSET_X/Y (translated to SCREEN_START_LEFT/TOP)
55 52
  * and spans LCD_PIXEL_WIDTH/HEIGHT (scaled to SCREEN_WIDTH/HEIGHT).
56 53
  */
57
-// Touch screen resolution independent of display resolution
58
-#define TOUCH_SCREEN_HEIGHT 240
59
-#define TOUCH_SCREEN_WIDTH 320
60 54
 
61 55
 // Coordinates in terms of touch area
62 56
 #define BUTTON_AREA_TOP 175
63 57
 #define BUTTON_AREA_BOT 234
64 58
 
65
-#define SCREEN_START_TOP  ((LCD_PIXEL_OFFSET_Y) * (TOUCH_SCREEN_HEIGHT) / (LCD_FULL_PIXEL_HEIGHT))
66
-#define SCREEN_START_LEFT ((LCD_PIXEL_OFFSET_X) * (TOUCH_SCREEN_WIDTH) / (LCD_FULL_PIXEL_WIDTH))
67
-#define SCREEN_HEIGHT     ((LCD_PIXEL_HEIGHT * FSMC_UPSCALE) * (TOUCH_SCREEN_HEIGHT) / (LCD_FULL_PIXEL_HEIGHT))
68
-#define SCREEN_WIDTH      ((LCD_PIXEL_WIDTH * FSMC_UPSCALE) * (TOUCH_SCREEN_WIDTH) / (LCD_FULL_PIXEL_WIDTH))
59
+// Touch sensor resolution independent of display resolution
60
+#define TOUCH_SENSOR_WIDTH  320
61
+#define TOUCH_SENSOR_HEIGHT 240
62
+
63
+#define SCREEN_WIDTH_PCT(X) ((X) * (TOUCH_SENSOR_WIDTH) / (LCD_FULL_PIXEL_WIDTH))
64
+#define SCREEN_HEIGHT_PCT(Y) ((Y) * (TOUCH_SENSOR_HEIGHT) / (LCD_FULL_PIXEL_HEIGHT))
65
+
66
+#define SCREEN_START_LEFT SCREEN_WIDTH_PCT(LCD_PIXEL_OFFSET_X)
67
+#define SCREEN_START_TOP  SCREEN_HEIGHT_PCT(LCD_PIXEL_OFFSET_Y)
68
+#define SCREEN_WIDTH      SCREEN_WIDTH_PCT((LCD_PIXEL_WIDTH) * (FSMC_UPSCALE))
69
+#define SCREEN_HEIGHT     SCREEN_HEIGHT_PCT((LCD_PIXEL_HEIGHT) * (FSMC_UPSCALE))
69 70
 
70
-#define TOUCHABLE_Y_HEIGHT  SCREEN_HEIGHT
71 71
 #define TOUCHABLE_X_WIDTH  SCREEN_WIDTH
72
+#define TOUCHABLE_Y_HEIGHT SCREEN_HEIGHT
72 73
 
73 74
 #ifndef TOUCH_INT_PIN
74 75
   #define TOUCH_INT_PIN  -1
@@ -125,8 +126,8 @@ uint8_t XPT2046::read_buttons() {
125 126
     if (!isTouched()) return 0; // Fingers must still be on the TS for a valid read.
126 127
 
127 128
     #if ENABLED(GRAPHICAL_TFT_ROTATE_180)
128
-      x = TOUCH_SCREEN_WIDTH - x;
129
-      y = TOUCH_SCREEN_HEIGHT - y;
129
+      x = TOUCH_SENSOR_WIDTH - x;
130
+      y = TOUCH_SENSOR_HEIGHT - y;
130 131
     #endif
131 132
 
132 133
     // Touch within the button area simulates an encoder button
@@ -137,11 +138,11 @@ uint8_t XPT2046::read_buttons() {
137 138
           : WITHIN(x, 242, 305) ? EN_C
138 139
           : 0;
139 140
 
140
-    if (x > TOUCH_SCREEN_WIDTH || !WITHIN(y, SCREEN_START_TOP, SCREEN_START_TOP + SCREEN_HEIGHT)) return 0;
141
+    if (x > TOUCH_SENSOR_WIDTH || !WITHIN(y, SCREEN_START_TOP, SCREEN_START_TOP + SCREEN_HEIGHT)) return 0;
141 142
 
142 143
     // Column and row above BUTTON_AREA_TOP
143 144
     int8_t col = (x - (SCREEN_START_LEFT)) * (LCD_WIDTH) / (TOUCHABLE_X_WIDTH),
144
-          row = (y - (SCREEN_START_TOP)) * (LCD_HEIGHT) / (TOUCHABLE_Y_HEIGHT);
145
+           row = (y - (SCREEN_START_TOP)) * (LCD_HEIGHT) / (TOUCHABLE_Y_HEIGHT);
145 146
 
146 147
     // Send the touch to the UI (which will simulate the encoder wheel)
147 148
     MarlinUI::screen_click(row, col, x, y);

Marlin/src/feature/touch/xpt2046.h → Marlin/src/lcd/touch/xpt2046.h Просмотреть файл


+ 1
- 1
Marlin/src/lcd/ultralcd.cpp Просмотреть файл

@@ -150,7 +150,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
150 150
     volatile uint8_t MarlinUI::slow_buttons;
151 151
   #endif
152 152
   #if HAS_TOUCH_XPT2046
153
-    #include "../feature/touch/xpt2046.h"
153
+    #include "touch/xpt2046.h"
154 154
     bool MarlinUI::on_edit_screen = false;
155 155
   #endif
156 156
 #endif

+ 19
- 22
Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h Просмотреть файл

@@ -112,10 +112,6 @@
112 112
 
113 113
 #if ENABLED(FSMC_GRAPHICAL_TFT)
114 114
   #define FSMC_UPSCALE 3
115
-  #define LCD_FULL_PIXEL_WIDTH               480
116
-  #define LCD_PIXEL_OFFSET_X                  48
117
-  #define LCD_FULL_PIXEL_HEIGHT              320
118
-  #define LCD_PIXEL_OFFSET_Y                  48
119 115
 
120 116
   #define LCD_RESET_PIN                     PF11
121 117
   #define LCD_BACKLIGHT_PIN                 PD13
@@ -161,7 +157,7 @@
161 157
   #define HAS_BAK_VIEW_IN_FLASH 0
162 158
   #define HAS_LOGO_IN_FLASH 0
163 159
 
164
-  //SPI 2
160
+  // SPI 2
165 161
   #define W25QXX_CS_PIN                     PB12
166 162
   #define W25QXX_MOSI_PIN                   PB15
167 163
   #define W25QXX_MISO_PIN                   PB14
@@ -171,31 +167,32 @@
171 167
   #define TOUCH_SCK_PIN                     PA5   // SPI1_SCK
172 168
   #define TOUCH_MISO_PIN                    PA6   // SPI1_MISO
173 169
   #define TOUCH_MOSI_PIN                    PA7   // SPI1_MOSI
174
-  // #define TOUCH_INT_PIN                   PB6
175
-
176
-  #define SPI_TFT_CS_PIN            TOUCH_CS_PIN
177
-  #define SPI_TFT_SCK_PIN          TOUCH_SCK_PIN
178
-  #define SPI_TFT_MISO_PIN        TOUCH_MISO_PIN
179
-  #define SPI_TFT_MOSI_PIN        TOUCH_MOSI_PIN
180
-  #define SPI_TFT_DC_PIN                    PB6
181
-  #define SPI_TFT_RST_PIN                   PF11
170
+  //#define TOUCH_INT_PIN                   PB6
171
+
172
+  #if ENABLED(TFT_LVGL_UI_SPI)
173
+    #define SPI_TFT_CS_PIN          TOUCH_CS_PIN
174
+    #define SPI_TFT_SCK_PIN        TOUCH_SCK_PIN
175
+    #define SPI_TFT_MISO_PIN      TOUCH_MISO_PIN
176
+    #define SPI_TFT_MOSI_PIN      TOUCH_MOSI_PIN
177
+    #define SPI_TFT_DC_PIN                  PB6
178
+    #define SPI_TFT_RST_PIN                 PF11
179
+  #endif
182 180
 
183 181
   #define LCD_RESET_PIN                     PF11
184 182
   #define LCD_BACKLIGHT_PIN                 PD13
185
-  #define FSMC_CS_PIN                       PD7
186
-  #define FSMC_RS_PIN                       PD11
187 183
 
188 184
   #define LCD_USE_DMA_FSMC                        // Use DMA transfers to send data to the TFT
185
+  #define FSMC_CS_PIN                       PD7
186
+  #define FSMC_RS_PIN                       PD11
189 187
   #define FSMC_DMA_DEV                      DMA2
190 188
   #define FSMC_DMA_CHANNEL               DMA_CH5
191 189
 
192
-  #define LCD_FULL_PIXEL_WIDTH 480
193
-  #define LCD_PIXEL_OFFSET_X 48
194
-  #define LCD_FULL_PIXEL_HEIGHT 320
195
-  #define LCD_PIXEL_OFFSET_Y 48
196
-
197
-  #define LCD_PIXEL_HEIGHT 320
198
-  #define LCD_PIXEL_WIDTH 480
190
+  #define LCD_PIXEL_WIDTH       480
191
+  #define LCD_PIXEL_HEIGHT      320
192
+  #define LCD_FULL_PIXEL_WIDTH  LCD_PIXEL_WIDTH
193
+  #define LCD_FULL_PIXEL_HEIGHT LCD_PIXEL_HEIGHT
194
+  #define LCD_PIXEL_OFFSET_X     48
195
+  #define LCD_PIXEL_OFFSET_Y     48
199 196
 
200 197
   #define XPT2046_X_CALIBRATION  -12316
201 198
   #define XPT2046_Y_CALIBRATION   8981

+ 19
- 22
Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h Просмотреть файл

@@ -118,10 +118,6 @@
118 118
 //
119 119
 #if ENABLED(FSMC_GRAPHICAL_TFT)
120 120
   #define FSMC_UPSCALE 3
121
-  #define LCD_FULL_PIXEL_WIDTH               480
122
-  #define LCD_PIXEL_OFFSET_X                  48
123
-  #define LCD_FULL_PIXEL_HEIGHT              320
124
-  #define LCD_PIXEL_OFFSET_Y                  48
125 121
 
126 122
   #define LCD_RESET_PIN                     PF11
127 123
   #define LCD_BACKLIGHT_PIN                 PD13
@@ -166,7 +162,7 @@
166 162
   #define HAS_BAK_VIEW_IN_FLASH 0
167 163
   #define HAS_LOGO_IN_FLASH 0
168 164
 
169
-  //SPI 2
165
+  // SPI 2
170 166
   #define W25QXX_CS_PIN                     PB12
171 167
   #define W25QXX_MOSI_PIN                   PB15
172 168
   #define W25QXX_MISO_PIN                   PB14
@@ -176,31 +172,32 @@
176 172
   #define TOUCH_SCK_PIN                     PA5   // SPI1_SCK
177 173
   #define TOUCH_MISO_PIN                    PA6   // SPI1_MISO
178 174
   #define TOUCH_MOSI_PIN                    PA7   // SPI1_MOSI
179
-  // #define TOUCH_INT_PIN                   PB6
180
-
181
-  #define SPI_TFT_CS_PIN            TOUCH_CS_PIN
182
-  #define SPI_TFT_SCK_PIN          TOUCH_SCK_PIN
183
-  #define SPI_TFT_MISO_PIN        TOUCH_MISO_PIN
184
-  #define SPI_TFT_MOSI_PIN        TOUCH_MOSI_PIN
185
-  #define SPI_TFT_DC_PIN                    PB6
186
-  #define SPI_TFT_RST_PIN                   PF11
175
+  //#define TOUCH_INT_PIN                   PB6
176
+
177
+  #if ENABLED(TFT_LVGL_UI_SPI)
178
+    #define SPI_TFT_CS_PIN          TOUCH_CS_PIN
179
+    #define SPI_TFT_SCK_PIN        TOUCH_SCK_PIN
180
+    #define SPI_TFT_MISO_PIN      TOUCH_MISO_PIN
181
+    #define SPI_TFT_MOSI_PIN      TOUCH_MOSI_PIN
182
+    #define SPI_TFT_DC_PIN                  PB6
183
+    #define SPI_TFT_RST_PIN                 PF11
184
+  #endif
187 185
 
188 186
   #define LCD_RESET_PIN                     PF11
189 187
   #define LCD_BACKLIGHT_PIN                 PD13
190
-  #define FSMC_CS_PIN                       PD7
191
-  #define FSMC_RS_PIN                       PD11
192 188
 
193 189
   #define LCD_USE_DMA_FSMC                        // Use DMA transfers to send data to the TFT
190
+  #define FSMC_CS_PIN                       PD7
191
+  #define FSMC_RS_PIN                       PD11
194 192
   #define FSMC_DMA_DEV                      DMA2
195 193
   #define FSMC_DMA_CHANNEL               DMA_CH5
196 194
 
197
-  #define LCD_FULL_PIXEL_WIDTH 480
198
-  #define LCD_PIXEL_OFFSET_X 48
199
-  #define LCD_FULL_PIXEL_HEIGHT 320
200
-  #define LCD_PIXEL_OFFSET_Y 48
201
-
202
-  #define LCD_PIXEL_HEIGHT 320
203
-  #define LCD_PIXEL_WIDTH 480
195
+  #define LCD_PIXEL_WIDTH       480
196
+  #define LCD_PIXEL_HEIGHT      320
197
+  #define LCD_FULL_PIXEL_WIDTH  LCD_PIXEL_WIDTH
198
+  #define LCD_FULL_PIXEL_HEIGHT LCD_PIXEL_HEIGHT
199
+  #define LCD_PIXEL_OFFSET_X     48
200
+  #define LCD_PIXEL_OFFSET_Y     48
204 201
 
205 202
   #define XPT2046_X_CALIBRATION  -12316
206 203
   #define XPT2046_Y_CALIBRATION   8981

+ 1
- 10
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h Просмотреть файл

@@ -294,7 +294,7 @@
294 294
     #define TOUCH_BUTTONS_HW_SPI_DEVICE     1
295 295
 
296 296
     //#define TOUCH_SCREEN
297
-    #if NEED_TOUCH_PINS
297
+    #if EITHER(TOUCH_SCREEN, NEED_TOUCH_PINS)
298 298
       #define TOUCH_CS_PIN                  PE14  // SPI1_NSS
299 299
       #define TOUCH_SCK_PIN                 PA5   // SPI1_SCK
300 300
       #define TOUCH_MISO_PIN                PA6   // SPI1_MISO
@@ -317,15 +317,6 @@
317 317
     #ifndef FSMC_UPSCALE
318 318
       #define FSMC_UPSCALE                     3
319 319
     #endif
320
-    #ifndef LCD_FULL_PIXEL_WIDTH
321
-      #define LCD_FULL_PIXEL_WIDTH           480
322
-    #endif
323
-    #ifndef LCD_PIXEL_OFFSET_X
324
-      #define LCD_PIXEL_OFFSET_X              48
325
-    #endif
326
-    #ifndef LCD_FULL_PIXEL_HEIGHT
327
-      #define LCD_FULL_PIXEL_HEIGHT          320
328
-    #endif
329 320
     #ifndef LCD_PIXEL_OFFSET_Y
330 321
       #define LCD_PIXEL_OFFSET_Y              32
331 322
     #endif

Загрузка…
Отмена
Сохранить