Skip to content

Commit bb76e49

Browse files
committed
🩹 Fix TFT LVGL compile error
Fixes regression from MarlinFirmware#24302
1 parent 06b1f85 commit bb76e49

File tree

7 files changed

+29
-9
lines changed

7 files changed

+29
-9
lines changed

.github/workflows/test-builds.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ jobs:
105105
- FYSETC_S6
106106
- LERDGEK
107107
- LERDGEX
108+
- mks_robin_pro2
108109
- Opulo_Lumen_REV3
109110
- rumba32
110111
- STM32F401RC_creality

Marlin/src/inc/SanityCheck.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2629,10 +2629,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
26292629

26302630
#if ENABLED(TFT_GENERIC) && NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
26312631
#error "TFT_GENERIC requires either TFT_INTERFACE_FSMC or TFT_INTERFACE_SPI interface."
2632-
#endif
2633-
2634-
#if BOTH(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
2635-
#error "Please enable only one of TFT_INTERFACE_SPI or TFT_INTERFACE_SPI."
2632+
#elif BOTH(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
2633+
#error "Please enable only one of TFT_INTERFACE_FSMC or TFT_INTERFACE_SPI."
26362634
#endif
26372635

26382636
#if defined(LCD_SCREEN_ROTATE) && LCD_SCREEN_ROTATE != 0 && LCD_SCREEN_ROTATE != 90 && LCD_SCREEN_ROTATE != 180 && LCD_SCREEN_ROTATE != 270

Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ void tft_lvgl_init() {
138138
uint16_t usb_flash_loop = 1000;
139139
#if ENABLED(MULTI_VOLUME) && !HAS_SD_HOST_DRIVE
140140
SET_INPUT_PULLUP(SD_DETECT_PIN);
141-
card.changeMedia(IS_SD_INSERTED() ? &card.media_driver_sdcard : &card.media_driver_usbFlash);
141+
if (IS_SD_INSERTED())
142+
card.changeMedia(&card.media_driver_sdcard);
143+
else
144+
card.changeMedia(&card.media_driver_usbFlash);
142145
#endif
143146
do {
144147
card.media_driver_usbFlash.idle();

Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@
227227

228228
#define SPI_FLASH
229229
#if ENABLED(SPI_FLASH)
230-
#define SPI_FLASH
231230
#define SPI_DEVICE 2
232231
#define SPI_FLASH_SIZE 0x1000000
233232
#define SPI_FLASH_CS_PIN PB12

Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@
274274
//
275275
// LCD / Controller
276276
#define SPI_FLASH
277-
#define SPI_FLASH
278277
#define SPI_DEVICE 2
279278
#define SPI_FLASH_SIZE 0x1000000
280279
#if ENABLED(SPI_FLASH)

buildroot/share/PlatformIO/scripts/download_mks_assets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
assets_path = Path(env.Dictionary("PROJECT_BUILD_DIR"), env.Dictionary("PIOENV"), "assets")
1515

1616
def download_mks_assets():
17-
print("Downloading MKS Assets")
17+
print("Downloading MKS Assets for TFT_LVGL_UI")
1818
r = requests.get(url, stream=True)
1919
# the user may have a very clean workspace,
2020
# so create the PROJECT_LIBDEPS_DIR directory if not exits
@@ -25,7 +25,7 @@ def download_mks_assets():
2525
fd.write(chunk)
2626

2727
def copy_mks_assets():
28-
print("Copying MKS Assets")
28+
print("Copying MKS Assets for TFT_LVGL_UI")
2929
output_path = Path(tempfile.mkdtemp())
3030
zip_obj = zipfile.ZipFile(zip_path, 'r')
3131
zip_obj.extractall(output_path)

buildroot/tests/mks_robin_pro2

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Build tests for mks_robin_pro2 (STM32F407VE)
4+
#
5+
6+
# exit on first failure
7+
set -e
8+
9+
#
10+
# Robin Pro v2 with LVGL TFT
11+
#
12+
restore_configs
13+
opt_set MOTHERBOARD BOARD_MKS_ROBIN_PRO_V2 SERIAL_PORT 1
14+
opt_enable SDSUPPORT USB_FLASH_DRIVE_SUPPORT USE_OTG_USB_HOST MULTI_VOLUME \
15+
TFT_GENERIC TFT_INTERFACE_SPI TFT_RES_480x320 TFT_LVGL_UI TOUCH_SCREEN \
16+
BLTOUCH Z_SAFE_HOMING LCD_BED_TRAMMING BED_TRAMMING_USE_PROBE
17+
exec_test $1 $2 "MKS Robin Pro v2 | TFT_LVGL_UI | SD/FD Multi-Volume" "$3"
18+
19+
# cleanup
20+
restore_configs

0 commit comments

Comments
 (0)