Skip to content

Commit

Permalink
Robin nano V2, TFT LVGL UI parameters, and more (#18500)
Browse files Browse the repository at this point in the history
  • Loading branch information
MKS-Sean authored Jul 25, 2020
1 parent c5ec80d commit 445dc7a
Show file tree
Hide file tree
Showing 90 changed files with 11,762 additions and 4,220 deletions.
21 changes: 12 additions & 9 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
//#define CUSTOM_MACHINE_NAME "3D Printer"

// Printer's unique ID, used by some programs to differentiate between machines.
// Choose your own or use a service like http://www.uuidgenerator.net/version4
// Choose your own or use a service like https://www.uuidgenerator.net/version4
//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000"

// @section extruder
Expand Down Expand Up @@ -2148,20 +2148,23 @@
//
// TFT LVGL UI
//
// Default MKS icons and fonts: https://git.io/JJvzK
// Copy mks_pic and mks_font folders to the root of your SD
// Using default MKS icons and fonts from: https://git.io/JJvzK
// Just copy the `assets` folder from the build directory to the
// root of your SD card, together with the compiled firmware.
//
//#define TFT_LVGL_UI
// Robin nano v1.2 uses FSMC
//
//#define TFT_LVGL_UI_FSMC

// Robin nano v2.0 uses SPI
//
//#define TFT_LVGL_UI_SPI


//=============================================================================
//============================ Other Controllers ============================
//=============================================================================

//
// Robin nano v2.0 SPI touch screen
//
//#define SPI_GRAPHICAL_TFT

//
// Ender-3 v2 OEM display. A DWIN display with Rotary Encoder.
//
Expand Down
6 changes: 3 additions & 3 deletions Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@
* Set the vendor info the serial USB interface, if changable
* Currently only supported by DUE platform
*/
//#define USB_DEVICE_VENDOR_ID 0x0000
//#define USB_DEVICE_PRODUCT_ID 0x0000
//#define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL
//#define USB_DEVICE_VENDOR_ID 0x0000
//#define USB_DEVICE_PRODUCT_ID 0x0000
//#define USB_DEVICE_MANUFACTURE_NAME WEBSITE_URL
11 changes: 6 additions & 5 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@
#include "gcode/parser.h"
#include "gcode/queue.h"

#if ENABLED(TFT_LVGL_UI)
#include "lvgl.h"
#if HAS_TFT_LVGL_UI
#include "lcd/extui/lib/mks_ui/tft_lvgl_configuration.h"
#include "lcd/extui/lib/mks_ui/draw_ui.h"
#include "lcd/extui/lib/mks_ui/mks_hardware_test.h"
#include <lvgl.h>
#endif

#if ENABLED(DWIN_CREALITY_LCD)
Expand Down Expand Up @@ -755,7 +756,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
// Direct Stepping
TERN_(DIRECT_STEPPING, page_manager.write_responses());

#if ENABLED(TFT_LVGL_UI)
#if HAS_TFT_LVGL_UI
LV_TASK_HANDLER();
#endif
}
Expand Down Expand Up @@ -1192,7 +1193,7 @@ void setup() {
SETUP_RUN(page_manager.init());
#endif

#if ENABLED(TFT_LVGL_UI)
#if HAS_TFT_LVGL_UI
if (!card.isMounted()) SETUP_RUN(card.mount()); // Mount SD to load graphics and fonts
SETUP_RUN(tft_lvgl_init());
#endif
Expand Down Expand Up @@ -1229,7 +1230,7 @@ void loop() {

endstops.event_handler();

TERN_(TFT_LVGL_UI, printer_state_polling());
TERN_(HAS_TFT_LVGL_UI, printer_state_polling());

} while (ENABLED(__AVR__)); // Loop forever on slower (AVR) boards
}
49 changes: 25 additions & 24 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,30 +288,31 @@
#define BOARD_MKS_ROBIN 4007 // MKS Robin (STM32F103ZET6)
#define BOARD_MKS_ROBIN_MINI 4008 // MKS Robin Mini (STM32F103VET6)
#define BOARD_MKS_ROBIN_NANO 4009 // MKS Robin Nano (STM32F103VET6)
#define BOARD_MKS_ROBIN_LITE 4010 // MKS Robin Lite/Lite2 (STM32F103RCT6)
#define BOARD_MKS_ROBIN_LITE3 4011 // MKS Robin Lite3 (STM32F103RCT6)
#define BOARD_MKS_ROBIN_PRO 4012 // MKS Robin Pro (STM32F103ZET6)
#define BOARD_BTT_SKR_MINI_V1_1 4013 // BigTreeTech SKR Mini v1.1 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V1_0 4014 // BigTreeTech SKR Mini E3 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V1_2 4015 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V2_0 4016 // BigTreeTech SKR Mini E3 V2.0 (STM32F103RC)
#define BOARD_BTT_SKR_E3_DIP 4017 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
#define BOARD_JGAURORA_A5S_A1 4018 // JGAurora A5S A1 (STM32F103ZET6)
#define BOARD_FYSETC_AIO_II 4019 // FYSETC AIO_II
#define BOARD_FYSETC_CHEETAH 4020 // FYSETC Cheetah
#define BOARD_FYSETC_CHEETAH_V12 4021 // FYSETC Cheetah V1.2
#define BOARD_LONGER3D_LK 4022 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6
#define BOARD_GTM32_MINI 4023 // STM32F103VET6 controller
#define BOARD_GTM32_MINI_A30 4024 // STM32F103VET6 controller
#define BOARD_GTM32_REV_B 4025 // STM32F103VET6 controller
#define BOARD_MKS_ROBIN_E3D 4026 // MKS Robin E3D (STM32F103RCT6)
#define BOARD_MKS_ROBIN_E3 4027 // MKS Robin E3 (STM32F103RCT6)
#define BOARD_MALYAN_M300 4028 // STM32F070-based delta
#define BOARD_CCROBOT_MEEB_3DP 4029 // ccrobot-online.com MEEB_3DP (STM32F103RC)
#define BOARD_CHITU3D_V5 4030 // Chitu3D TronXY X5SA V5 Board
#define BOARD_CHITU3D_V6 4031 // Chitu3D TronXY X5SA V5 Board
#define BOARD_CREALITY_V4 4032 // Creality v4.x (STM32F103RE)
#define BOARD_TRIGORILLA_PRO 4033 // Trigorilla Pro (STM32F103ZET6)
#define BOARD_MKS_ROBIN_NANO_V2 4010 // MKS Robin Nano V2 (STM32F103VET6)
#define BOARD_MKS_ROBIN_LITE 4011 // MKS Robin Lite/Lite2 (STM32F103RCT6)
#define BOARD_MKS_ROBIN_LITE3 4012 // MKS Robin Lite3 (STM32F103RCT6)
#define BOARD_MKS_ROBIN_PRO 4013 // MKS Robin Pro (STM32F103ZET6)
#define BOARD_BTT_SKR_MINI_V1_1 4014 // BigTreeTech SKR Mini v1.1 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V1_0 4015 // BigTreeTech SKR Mini E3 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V1_2 4016 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V2_0 4017 // BigTreeTech SKR Mini E3 V2.0 (STM32F103RC)
#define BOARD_BTT_SKR_E3_DIP 4018 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
#define BOARD_JGAURORA_A5S_A1 4019 // JGAurora A5S A1 (STM32F103ZET6)
#define BOARD_FYSETC_AIO_II 4020 // FYSETC AIO_II
#define BOARD_FYSETC_CHEETAH 4021 // FYSETC Cheetah
#define BOARD_FYSETC_CHEETAH_V12 4022 // FYSETC Cheetah V1.2
#define BOARD_LONGER3D_LK 4023 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6
#define BOARD_GTM32_MINI 4024 // STM32F103VET6 controller
#define BOARD_GTM32_MINI_A30 4025 // STM32F103VET6 controller
#define BOARD_GTM32_REV_B 4026 // STM32F103VET6 controller
#define BOARD_MKS_ROBIN_E3D 4027 // MKS Robin E3D (STM32F103RCT6)
#define BOARD_MKS_ROBIN_E3 4028 // MKS Robin E3 (STM32F103RCT6)
#define BOARD_MALYAN_M300 4029 // STM32F070-based delta
#define BOARD_CCROBOT_MEEB_3DP 4030 // ccrobot-online.com MEEB_3DP (STM32F103RC)
#define BOARD_CHITU3D_V5 4031 // Chitu3D TronXY X5SA V5 Board
#define BOARD_CHITU3D_V6 4032 // Chitu3D TronXY X5SA V5 Board
#define BOARD_CREALITY_V4 4033 // Creality v4.x (STM32F103RE)
#define BOARD_TRIGORILLA_PRO 4034 // Trigorilla Pro (STM32F103ZET6)

//
// ARM Cortex-M4F
Expand Down
7 changes: 6 additions & 1 deletion Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,17 @@
#define IS_ULTIPANEL
#endif

// LVGL UI, SPI or FSMC
#if EITHER(TFT_LVGL_UI_SPI, TFT_LVGL_UI_FSMC)
#define HAS_TFT_LVGL_UI 1
#endif

// FSMC/SPI TFT Panels
#if ENABLED(FSMC_GRAPHICAL_TFT)
#define DOGLCD
#define IS_ULTIPANEL
#define DELAYED_BACKLIGHT_INIT
#elif ENABLED(SPI_GRAPHICAL_TFT)
#elif ENABLED(TFT_LVGL_UI_SPI)
#define DELAYED_BACKLIGHT_INIT
#endif

Expand Down
8 changes: 6 additions & 2 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@
#error "POWER_SUPPLY is now obsolete. Please remove it from Configuration.h."
#elif defined(MKS_ROBIN_TFT)
#error "MKS_ROBIN_TFT is now FSMC_GRAPHICAL_TFT. Please update your configuration."
#elif defined(TFT_LVGL_UI)
#error "TFT_LVGL_UI is now TFT_LVGL_UI_FSMC. Please update your configuration."
#elif defined(SPI_GRAPHICAL_TFT)
#error "SPI_GRAPHICAL_TFT is now TFT_LVGL_UI_SPI. Please update your configuration."
#elif defined(SDPOWER)
#error "SDPOWER is now SDPOWER_PIN. Please update your configuration and/or pins."
#elif defined(STRING_SPLASH_LINE1) || defined(STRING_SPLASH_LINE2)
Expand Down Expand Up @@ -2217,8 +2221,8 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
+ ENABLED(MALYAN_LCD) \
+ ENABLED(TOUCH_UI_FTDI_EVE) \
+ ENABLED(FSMC_GRAPHICAL_TFT) \
+ ENABLED(TFT_LVGL_UI) \
+ ENABLED(SPI_GRAPHICAL_TFT)
+ ENABLED(TFT_LVGL_UI_FSMC) \
+ ENABLED(TFT_LVGL_UI_SPI)
#error "Please select no more than one LCD controller option."
#endif

Expand Down
Loading

0 comments on commit 445dc7a

Please sign in to comment.