From 7cef4f52a94f57b4f8e88cb4a95d55a7235aa59c Mon Sep 17 00:00:00 2001 From: George Fu Date: Tue, 11 Feb 2020 10:14:39 +0800 Subject: [PATCH 1/6] Support ftdi screen for FYSETC S6 --- Marlin/Configuration_adv.h | 1 + .../src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/compat.h | 4 ++++ .../extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 2e0a5b5c50fc..1f0e8b3e09a0 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1334,6 +1334,7 @@ //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping //#define OTHER_PIN_LAYOUT // Define pins manually below + #define FYSETC_S6_TFT_PINMAP // FYSETC S6 pin mapping #if ENABLED(OTHER_PIN_LAYOUT) // The pins for CS and MOD_RESET (PD) must be chosen. #define CLCD_MOD_RESET 9 diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/compat.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/compat.h index 90fd615a5d73..c3e8052a0e51 100644 --- a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/compat.h +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/compat.h @@ -37,6 +37,10 @@ #ifdef __MARLIN_FIRMWARE__ // __MARLIN_FIRMWARE__ exists when compiled within Marlin. #include "pin_mappings.h" + #undef max + #define max(a,b) ((a)>(b)?(a):(b)) + #undef min + #define min(a,b) ((a)<(b)?(a):(b)) #else namespace UI { static inline uint32_t safe_millis() {return millis();}; diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h index d474644b8c75..4c553c22012c 100644 --- a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h @@ -27,6 +27,15 @@ * without adding new pin definitions to the board. */ +#ifdef FYSETC_S6_TFT_PINMAP + #ifndef __MARLIN_FIRMWARE__ + #error This pin mapping requires Marlin. + #endif + + #define CLCD_SPI_CS PC7 + #define CLCD_MOD_RESET PC6 +#endif + #ifdef CR10_TFT_PINMAP #ifndef __MARLIN_FIRMWARE__ #error "This pin mapping requires Marlin." From dfc81f0c9cdbd32357e02390b0af7695b078b8e9 Mon Sep 17 00:00:00 2001 From: George Fu Date: Tue, 11 Feb 2020 10:15:18 +0800 Subject: [PATCH 2/6] Update FYSETC S6 pins --- Marlin/src/pins/stm32/pins_FYSETC_S6.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Marlin/src/pins/stm32/pins_FYSETC_S6.h b/Marlin/src/pins/stm32/pins_FYSETC_S6.h index 4b85e6097cd9..d28b42a8258e 100644 --- a/Marlin/src/pins/stm32/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32/pins_FYSETC_S6.h @@ -58,6 +58,14 @@ #define Z_MIN_PIN PA0 #define Z_MAX_PIN PA3 +// +// Filament Sensor +// share with X_MAX_PIN +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PA1 +#endif + // // Servos // share with Z_MAX_PIN @@ -160,6 +168,7 @@ //#define KILL_PIN PC5 #define SDSS PA4 +#define SD_DETECT_PIN PB10 // // LCD / Controller @@ -189,7 +198,6 @@ #define BTN_EN1 PC6 #define BTN_EN2 PC7 - #define SD_DETECT_PIN PB10 #define LCD_SDSS PA4 From a853b8b621d6befad212cf32cb6908c7b9d0d941 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 11 Feb 2020 02:09:47 -0600 Subject: [PATCH 3/6] Update pin_mappings.h --- .../src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h index 4c553c22012c..00e0a6d60a1b 100644 --- a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h @@ -29,7 +29,7 @@ #ifdef FYSETC_S6_TFT_PINMAP #ifndef __MARLIN_FIRMWARE__ - #error This pin mapping requires Marlin. + #error "This pin mapping requires Marlin." #endif #define CLCD_SPI_CS PC7 From 4df410c48005bd90475b27774b167724fbbe5f43 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Feb 2020 07:06:05 -0600 Subject: [PATCH 4/6] Update pins_FYSETC_S6.h --- Marlin/src/pins/stm32/pins_FYSETC_S6.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Marlin/src/pins/stm32/pins_FYSETC_S6.h b/Marlin/src/pins/stm32/pins_FYSETC_S6.h index d28b42a8258e..16f176a376f7 100644 --- a/Marlin/src/pins/stm32/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32/pins_FYSETC_S6.h @@ -48,6 +48,11 @@ #define E2END 0xFFF // 4KB #endif +// +// Servos +// +#define SERVO0_PIN PA3 + // // Limit Switches // @@ -60,18 +65,11 @@ // // Filament Sensor -// share with X_MAX_PIN // #ifndef FIL_RUNOUT_PIN #define FIL_RUNOUT_PIN PA1 #endif -// -// Servos -// share with Z_MAX_PIN -// -#define SERVO0_PIN PA3 - // // Steppers // From 3931e1c88ce9e3db920e0423a8973e1e86b68375 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Feb 2020 07:09:18 -0600 Subject: [PATCH 5/6] Update Configuration_adv.h --- Marlin/Configuration_adv.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 1f0e8b3e09a0..cb2bdc08b4c5 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1333,10 +1333,11 @@ //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping + //#define S6_TFT_PINMAP // FYSETC S6 pin mapping + //#define OTHER_PIN_LAYOUT // Define pins manually below - #define FYSETC_S6_TFT_PINMAP // FYSETC S6 pin mapping #if ENABLED(OTHER_PIN_LAYOUT) - // The pins for CS and MOD_RESET (PD) must be chosen. + // Pins for CS and MOD_RESET (PD) must be chosen #define CLCD_MOD_RESET 9 #define CLCD_SPI_CS 10 From a6f5802f1a96e91a89d771ac3f407ccddf521fef Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Feb 2020 07:16:10 -0600 Subject: [PATCH 6/6] Update pin_mappings.h --- .../src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h index 00e0a6d60a1b..548c6c7439d4 100644 --- a/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h +++ b/Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/pin_mappings.h @@ -27,7 +27,7 @@ * without adding new pin definitions to the board. */ -#ifdef FYSETC_S6_TFT_PINMAP +#ifdef S6_TFT_PINMAP #ifndef __MARLIN_FIRMWARE__ #error "This pin mapping requires Marlin." #endif