Skip to content

Commit

Permalink
🩹 Fix TFT LVGL compile error
Browse files Browse the repository at this point in the history
Fixes regression from MarlinFirmware#24302
  • Loading branch information
thinkyhead committed May 21, 2023
1 parent 06b1f85 commit bb76e49
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ jobs:
- FYSETC_S6
- LERDGEK
- LERDGEX
- mks_robin_pro2
- Opulo_Lumen_REV3
- rumba32
- STM32F401RC_creality
Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -2629,10 +2629,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L

#if ENABLED(TFT_GENERIC) && NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
#error "TFT_GENERIC requires either TFT_INTERFACE_FSMC or TFT_INTERFACE_SPI interface."
#endif

#if BOTH(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
#error "Please enable only one of TFT_INTERFACE_SPI or TFT_INTERFACE_SPI."
#elif BOTH(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
#error "Please enable only one of TFT_INTERFACE_FSMC or TFT_INTERFACE_SPI."
#endif

#if defined(LCD_SCREEN_ROTATE) && LCD_SCREEN_ROTATE != 0 && LCD_SCREEN_ROTATE != 90 && LCD_SCREEN_ROTATE != 180 && LCD_SCREEN_ROTATE != 270
Expand Down
5 changes: 4 additions & 1 deletion Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ void tft_lvgl_init() {
uint16_t usb_flash_loop = 1000;
#if ENABLED(MULTI_VOLUME) && !HAS_SD_HOST_DRIVE
SET_INPUT_PULLUP(SD_DETECT_PIN);
card.changeMedia(IS_SD_INSERTED() ? &card.media_driver_sdcard : &card.media_driver_usbFlash);
if (IS_SD_INSERTED())
card.changeMedia(&card.media_driver_sdcard);
else
card.changeMedia(&card.media_driver_usbFlash);
#endif
do {
card.media_driver_usbFlash.idle();
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@

#define SPI_FLASH
#if ENABLED(SPI_FLASH)
#define SPI_FLASH
#define SPI_DEVICE 2
#define SPI_FLASH_SIZE 0x1000000
#define SPI_FLASH_CS_PIN PB12
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@
//
// LCD / Controller
#define SPI_FLASH
#define SPI_FLASH
#define SPI_DEVICE 2
#define SPI_FLASH_SIZE 0x1000000
#if ENABLED(SPI_FLASH)
Expand Down
4 changes: 2 additions & 2 deletions buildroot/share/PlatformIO/scripts/download_mks_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
assets_path = Path(env.Dictionary("PROJECT_BUILD_DIR"), env.Dictionary("PIOENV"), "assets")

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

def copy_mks_assets():
print("Copying MKS Assets")
print("Copying MKS Assets for TFT_LVGL_UI")
output_path = Path(tempfile.mkdtemp())
zip_obj = zipfile.ZipFile(zip_path, 'r')
zip_obj.extractall(output_path)
Expand Down
20 changes: 20 additions & 0 deletions buildroot/tests/mks_robin_pro2
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
#
# Build tests for mks_robin_pro2 (STM32F407VE)
#

# exit on first failure
set -e

#
# Robin Pro v2 with LVGL TFT
#
restore_configs
opt_set MOTHERBOARD BOARD_MKS_ROBIN_PRO_V2 SERIAL_PORT 1
opt_enable SDSUPPORT USB_FLASH_DRIVE_SUPPORT USE_OTG_USB_HOST MULTI_VOLUME \
TFT_GENERIC TFT_INTERFACE_SPI TFT_RES_480x320 TFT_LVGL_UI TOUCH_SCREEN \
BLTOUCH Z_SAFE_HOMING LCD_BED_TRAMMING BED_TRAMMING_USE_PROBE
exec_test $1 $2 "MKS Robin Pro v2 | TFT_LVGL_UI | SD/FD Multi-Volume" "$3"

# cleanup
restore_configs

0 comments on commit bb76e49

Please sign in to comment.