✨ BigTreeTech TFT35 SPI V1.0 (#22986)
This commit is contained in:
		
				
					committed by
					
						
						Scott Lahteine
					
				
			
			
				
	
			
			
			
						parent
						
							e44f2b7d2d
						
					
				
				
					commit
					5173a3140d
				
			@@ -78,13 +78,13 @@ TFT_IO tftio;
 | 
			
		||||
  #include "../marlinui.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if HAS_TOUCH_BUTTONS
 | 
			
		||||
  #include "../touch/touch_buttons.h"
 | 
			
		||||
  #if HAS_TOUCH_SLEEP
 | 
			
		||||
    #define HAS_TOUCH_BUTTONS_SLEEP 1
 | 
			
		||||
  #endif
 | 
			
		||||
#if HAS_TOUCH_BUTTONS && HAS_TOUCH_SLEEP
 | 
			
		||||
  #define HAS_TOUCH_BUTTONS_SLEEP 1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "../touch/touch_buttons.h"
 | 
			
		||||
#include "../scaled_tft.h"
 | 
			
		||||
 | 
			
		||||
#define X_HI (UPSCALE(TFT_PIXEL_OFFSET_X, WIDTH) - 1)
 | 
			
		||||
#define Y_HI (UPSCALE(TFT_PIXEL_OFFSET_Y, HEIGHT) - 1)
 | 
			
		||||
 | 
			
		||||
@@ -325,6 +325,7 @@ static bool preinit = true;
 | 
			
		||||
static uint8_t page;
 | 
			
		||||
 | 
			
		||||
#if HAS_TOUCH_BUTTONS
 | 
			
		||||
 | 
			
		||||
  static bool redrawTouchButtons = true;
 | 
			
		||||
  static void drawTouchButtons(u8g_t *u8g, u8g_dev_t *dev) {
 | 
			
		||||
    if (!redrawTouchButtons) return;
 | 
			
		||||
@@ -343,6 +344,7 @@ static uint8_t page;
 | 
			
		||||
    setWindow(u8g, dev, BUTTONC_X_LO, BUTTON_Y_LO, BUTTONC_X_HI, BUTTON_Y_HI);
 | 
			
		||||
    drawImage(buttonC, u8g, dev, BUTTON_DRAW_WIDTH, BUTTON_DRAW_HEIGHT, TFT_BTOKMENU_COLOR);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
#endif // HAS_TOUCH_BUTTONS
 | 
			
		||||
 | 
			
		||||
static void u8g_upscale_clear_lcd(u8g_t *u8g, u8g_dev_t *dev, uint16_t *buffer) {
 | 
			
		||||
@@ -395,7 +397,7 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u
 | 
			
		||||
          if (!sleepCleared) {
 | 
			
		||||
            sleepCleared = true;
 | 
			
		||||
            u8g_upscale_clear_lcd(u8g, dev, buffer);
 | 
			
		||||
            IF_ENABLED(HAS_TOUCH_BUTTONS, redrawTouchButtons = true);
 | 
			
		||||
            TERN_(HAS_TOUCH_BUTTONS, redrawTouchButtons = true);
 | 
			
		||||
          }
 | 
			
		||||
          break;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -255,6 +255,34 @@
 | 
			
		||||
  #define _DO_10(W,C,A,V...) (_##W##_1(A) C _DO_9(W,C,V))
 | 
			
		||||
  #define _DO_11(W,C,A,V...) (_##W##_1(A) C _DO_10(W,C,V))
 | 
			
		||||
  #define _DO_12(W,C,A,V...) (_##W##_1(A) C _DO_11(W,C,V))
 | 
			
		||||
  #define _DO_13(W,C,A,V...) (_##W##_1(A) C _DO_12(W,C,V))
 | 
			
		||||
  #define _DO_14(W,C,A,V...) (_##W##_1(A) C _DO_13(W,C,V))
 | 
			
		||||
  #define _DO_15(W,C,A,V...) (_##W##_1(A) C _DO_14(W,C,V))
 | 
			
		||||
  #define _DO_16(W,C,A,V...) (_##W##_1(A) C _DO_15(W,C,V))
 | 
			
		||||
  #define _DO_17(W,C,A,V...) (_##W##_1(A) C _DO_16(W,C,V))
 | 
			
		||||
  #define _DO_18(W,C,A,V...) (_##W##_1(A) C _DO_17(W,C,V))
 | 
			
		||||
  #define _DO_19(W,C,A,V...) (_##W##_1(A) C _DO_18(W,C,V))
 | 
			
		||||
  #define _DO_20(W,C,A,V...) (_##W##_1(A) C _DO_19(W,C,V))
 | 
			
		||||
  #define _DO_21(W,C,A,V...) (_##W##_1(A) C _DO_20(W,C,V))
 | 
			
		||||
  #define _DO_22(W,C,A,V...) (_##W##_1(A) C _DO_21(W,C,V))
 | 
			
		||||
  #define _DO_23(W,C,A,V...) (_##W##_1(A) C _DO_22(W,C,V))
 | 
			
		||||
  #define _DO_24(W,C,A,V...) (_##W##_1(A) C _DO_23(W,C,V))
 | 
			
		||||
  #define _DO_25(W,C,A,V...) (_##W##_1(A) C _DO_24(W,C,V))
 | 
			
		||||
  #define _DO_26(W,C,A,V...) (_##W##_1(A) C _DO_25(W,C,V))
 | 
			
		||||
  #define _DO_27(W,C,A,V...) (_##W##_1(A) C _DO_26(W,C,V))
 | 
			
		||||
  #define _DO_28(W,C,A,V...) (_##W##_1(A) C _DO_27(W,C,V))
 | 
			
		||||
  #define _DO_29(W,C,A,V...) (_##W##_1(A) C _DO_28(W,C,V))
 | 
			
		||||
  #define _DO_30(W,C,A,V...) (_##W##_1(A) C _DO_29(W,C,V))
 | 
			
		||||
  #define _DO_31(W,C,A,V...) (_##W##_1(A) C _DO_30(W,C,V))
 | 
			
		||||
  #define _DO_32(W,C,A,V...) (_##W##_1(A) C _DO_31(W,C,V))
 | 
			
		||||
  #define _DO_33(W,C,A,V...) (_##W##_1(A) C _DO_32(W,C,V))
 | 
			
		||||
  #define _DO_34(W,C,A,V...) (_##W##_1(A) C _DO_33(W,C,V))
 | 
			
		||||
  #define _DO_35(W,C,A,V...) (_##W##_1(A) C _DO_34(W,C,V))
 | 
			
		||||
  #define _DO_36(W,C,A,V...) (_##W##_1(A) C _DO_35(W,C,V))
 | 
			
		||||
  #define _DO_37(W,C,A,V...) (_##W##_1(A) C _DO_36(W,C,V))
 | 
			
		||||
  #define _DO_38(W,C,A,V...) (_##W##_1(A) C _DO_37(W,C,V))
 | 
			
		||||
  #define _DO_39(W,C,A,V...) (_##W##_1(A) C _DO_38(W,C,V))
 | 
			
		||||
  #define _DO_40(W,C,A,V...) (_##W##_1(A) C _DO_39(W,C,V))
 | 
			
		||||
  #define __DO_N(W,C,N,V...) _DO_##N(W,C,V)
 | 
			
		||||
  #define _DO_N(W,C,N,V...)  __DO_N(W,C,N,V)
 | 
			
		||||
  #define DO(W,C,V...)       _DO_N(W,C,NUM_ARGS(V),V)
 | 
			
		||||
 
 | 
			
		||||
@@ -27,6 +27,10 @@
 | 
			
		||||
#include "../../../inc/MarlinConfig.h"
 | 
			
		||||
#include "SPIFlashStorage.h"
 | 
			
		||||
 | 
			
		||||
#if !HAS_SPI_FLASH
 | 
			
		||||
  #error "HAS_SPI_FLASH is required with TFT_LVGL_UI."
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
extern W25QXXFlash W25QXX;
 | 
			
		||||
 | 
			
		||||
uint8_t SPIFlashStorage::m_pageData[SPI_FLASH_PageSize];
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user