Browse Source

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

vanilla_fb_2.0.x
Victor Oliveira 4 years ago
committed by GitHub
parent
commit
51a1561ae9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Marlin/src/lcd/tft/tft_queue.cpp
  2. 6
      Marlin/src/lcd/tft/tft_queue.h
  3. 3
      Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h

2
Marlin/src/lcd/tft/tft_queue.cpp

@ -210,7 +210,7 @@ void TFT_Queue::set_background(uint16_t color) {
#define QUEUE_SAFETY_FREE_SPACE 100 #define QUEUE_SAFETY_FREE_SPACE 100
void TFT_Queue::handle_queue_overflow(uint16_t sizeNeeded) { void TFT_Queue::handle_queue_overflow(uint16_t sizeNeeded) {
if (uintptr_t(end_of_queue) + sizeNeeded + (QUEUE_SAFETY_FREE_SPACE) - uintptr_t(queue) >= QUEUE_SIZE) { if (uintptr_t(end_of_queue) + sizeNeeded + (QUEUE_SAFETY_FREE_SPACE) - uintptr_t(queue) >= TFT_QUEUE_SIZE) {
end_of_queue = queue; end_of_queue = queue;
((parametersCanvasText_t *)last_parameter)->nextParameter = end_of_queue; ((parametersCanvasText_t *)last_parameter)->nextParameter = end_of_queue;
} }

6
Marlin/src/lcd/tft/tft_queue.h

@ -25,7 +25,9 @@
#include "tft_string.h" #include "tft_string.h"
#include "tft_image.h" #include "tft_image.h"
#define QUEUE_SIZE 8192 #ifndef TFT_QUEUE_SIZE
#define TFT_QUEUE_SIZE 8192
#endif
enum QueueTaskType : uint8_t { enum QueueTaskType : uint8_t {
TASK_END_OF_QUEUE = 0x00, TASK_END_OF_QUEUE = 0x00,
@ -118,7 +120,7 @@ typedef struct __attribute__((__packed__)) {
class TFT_Queue { class TFT_Queue {
private: private:
static uint8_t queue[QUEUE_SIZE]; static uint8_t queue[TFT_QUEUE_SIZE];
static uint8_t *end_of_queue; static uint8_t *end_of_queue;
static uint8_t *current_task; static uint8_t *current_task;
static uint8_t *last_task; static uint8_t *last_task;

3
Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h

@ -268,7 +268,8 @@
#define LCD_PINS_ENABLE -1 #define LCD_PINS_ENABLE -1
#define LCD_PINS_RS -1 #define LCD_PINS_RS -1
#define TFT_BUFFER_SIZE 2400 #define TFT_BUFFER_SIZE 1200
#define TFT_QUEUE_SIZE 6144
#define BTN_EN1 P3_25 #define BTN_EN1 P3_25
#define BTN_EN2 P3_26 #define BTN_EN2 P3_26

Loading…
Cancel
Save