Skip to content

Commit 7a1a38f

Browse files
committed
new class
1 parent 3b6ac0d commit 7a1a38f

5 files changed

+738
-3
lines changed

Marlin/Configuration.h

+7
Original file line numberDiff line numberDiff line change
@@ -2084,6 +2084,13 @@
20842084

20852085
//@
20862086
#define FSMC_GRAPHICAL_TFT
2087+
#if ENABLED(FSMC_GRAPHICAL_TFT)
2088+
//
2089+
// FSMC_UPSCALE 2 2x upscaler for 320x240 displays (default)
2090+
// FSMC_UPSCALE 3 3x upscaler for 480x320 displays
2091+
//
2092+
#define FSMC_UPSCALE 2
2093+
#endif
20872094

20882095
//=============================================================================
20892096
//============================ Other Controllers ============================

Marlin/src/lcd/dogm/HAL_LCD_class_defines.h

+12
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,18 @@ class U8GLIB_TFT_320X240_UPSCALE_FROM_128X64 : public U8GLIB {
9595
{ }
9696
};
9797

98+
//
99+
// Very basic support for 480x320 TFT screen
100+
//
101+
extern u8g_dev_t u8g_dev_tft_480x320_upscale_from_128x64;
102+
103+
class U8GLIB_TFT_480X320_UPSCALE_FROM_128X64 : public U8GLIB {
104+
public:
105+
U8GLIB_TFT_480X320_UPSCALE_FROM_128X64(uint8_t cs, uint8_t rs, uint8_t reset = U8G_PIN_NONE)
106+
: U8GLIB(&u8g_dev_tft_480x320_upscale_from_128x64, cs, rs, reset)
107+
{ }
108+
};
109+
98110

99111
extern u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_sw_spi, u8g_dev_uc1701_mini12864_HAL_2x_hw_spi;
100112

Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ static const uint8_t ili9341_init_sequence[] = { // 0x9341 - ILI9341
471471
// *check for button sizes and how to upscale to fit on screen
472472
// *check if other parts of marlin use drawImage
473473

474-
void drawImage(const uint8_t *data, u8g_t *u8g, u8g_dev_t *dev, uint16_t length, uint16_t height, uint16_t color) {
474+
static void drawImage(const uint8_t *data, u8g_t *u8g, u8g_dev_t *dev, uint16_t length, uint16_t height, uint16_t color) {
475475
static uint16_t p_buffer[288];
476476
uint16_t* buffer = &p_buffer[0];
477477

0 commit comments

Comments
 (0)