Browse Source

Reduce RAM usage for TFT Color UI on SGen-L (#20179)

Victor Oliveira 4 years ago
parent
commit
51a1561ae9
No account linked to committer's email address

+ 1
- 1
Marlin/src/lcd/tft/tft_queue.cpp View File

210
 #define QUEUE_SAFETY_FREE_SPACE 100
210
 #define QUEUE_SAFETY_FREE_SPACE 100
211
 
211
 
212
 void TFT_Queue::handle_queue_overflow(uint16_t sizeNeeded) {
212
 void TFT_Queue::handle_queue_overflow(uint16_t sizeNeeded) {
213
-  if (uintptr_t(end_of_queue) + sizeNeeded + (QUEUE_SAFETY_FREE_SPACE) - uintptr_t(queue) >= QUEUE_SIZE) {
213
+  if (uintptr_t(end_of_queue) + sizeNeeded + (QUEUE_SAFETY_FREE_SPACE) - uintptr_t(queue) >= TFT_QUEUE_SIZE) {
214
     end_of_queue = queue;
214
     end_of_queue = queue;
215
     ((parametersCanvasText_t *)last_parameter)->nextParameter = end_of_queue;
215
     ((parametersCanvasText_t *)last_parameter)->nextParameter = end_of_queue;
216
   }
216
   }

+ 4
- 2
Marlin/src/lcd/tft/tft_queue.h View File

25
 #include "tft_string.h"
25
 #include "tft_string.h"
26
 #include "tft_image.h"
26
 #include "tft_image.h"
27
 
27
 
28
-#define QUEUE_SIZE              8192
28
+#ifndef TFT_QUEUE_SIZE
29
+  #define TFT_QUEUE_SIZE              8192
30
+#endif
29
 
31
 
30
 enum QueueTaskType : uint8_t {
32
 enum QueueTaskType : uint8_t {
31
   TASK_END_OF_QUEUE = 0x00,
33
   TASK_END_OF_QUEUE = 0x00,
118
 
120
 
119
 class TFT_Queue {
121
 class TFT_Queue {
120
   private:
122
   private:
121
-    static uint8_t queue[QUEUE_SIZE];
123
+    static uint8_t queue[TFT_QUEUE_SIZE];
122
     static uint8_t *end_of_queue;
124
     static uint8_t *end_of_queue;
123
     static uint8_t *current_task;
125
     static uint8_t *current_task;
124
     static uint8_t *last_task;
126
     static uint8_t *last_task;

+ 2
- 1
Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h View File

268
     #define LCD_PINS_ENABLE                -1
268
     #define LCD_PINS_ENABLE                -1
269
     #define LCD_PINS_RS                    -1
269
     #define LCD_PINS_RS                    -1
270
 
270
 
271
-    #define TFT_BUFFER_SIZE                 2400
271
+    #define TFT_BUFFER_SIZE                 1200
272
+    #define TFT_QUEUE_SIZE                  6144
272
 
273
 
273
     #define BTN_EN1                        P3_25
274
     #define BTN_EN1                        P3_25
274
     #define BTN_EN2                        P3_26
275
     #define BTN_EN2                        P3_26

Loading…
Cancel
Save