Bladeren bron

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

Victor Oliveira 3 jaren geleden
bovenliggende
commit
51a1561ae9
No account linked to committer's email address
3 gewijzigde bestanden met toevoegingen van 7 en 4 verwijderingen
  1. 1
    1
      Marlin/src/lcd/tft/tft_queue.cpp
  2. 4
    2
      Marlin/src/lcd/tft/tft_queue.h
  3. 2
    1
      Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h

+ 1
- 1
Marlin/src/lcd/tft/tft_queue.cpp Bestand weergeven

@@ -210,7 +210,7 @@ void TFT_Queue::set_background(uint16_t color) {
210 210
 #define QUEUE_SAFETY_FREE_SPACE 100
211 211
 
212 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 214
     end_of_queue = queue;
215 215
     ((parametersCanvasText_t *)last_parameter)->nextParameter = end_of_queue;
216 216
   }

+ 4
- 2
Marlin/src/lcd/tft/tft_queue.h Bestand weergeven

@@ -25,7 +25,9 @@
25 25
 #include "tft_string.h"
26 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 32
 enum QueueTaskType : uint8_t {
31 33
   TASK_END_OF_QUEUE = 0x00,
@@ -118,7 +120,7 @@ typedef struct __attribute__((__packed__)) {
118 120
 
119 121
 class TFT_Queue {
120 122
   private:
121
-    static uint8_t queue[QUEUE_SIZE];
123
+    static uint8_t queue[TFT_QUEUE_SIZE];
122 124
     static uint8_t *end_of_queue;
123 125
     static uint8_t *current_task;
124 126
     static uint8_t *last_task;

+ 2
- 1
Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h Bestand weergeven

@@ -268,7 +268,8 @@
268 268
     #define LCD_PINS_ENABLE                -1
269 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 274
     #define BTN_EN1                        P3_25
274 275
     #define BTN_EN2                        P3_26

Laden…
Annuleren
Opslaan