From 7cf2788cc3287a7e03c910b80d9f9cfce77be448 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 17 Mar 2018 02:37:14 -0500 Subject: [PATCH] Easier override of ST7920 LCD timing --- Marlin/pins_ANET_10.h | 12 +++++++++--- Marlin/pins_MELZI_CREALITY.h | 12 +++++++++--- Marlin/pins_MELZI_MALYAN.h | 12 +++++++++--- Marlin/pins_MELZI_TRONXY.h | 12 +++++++++--- Marlin/pins_PRINTRBOARD_REVF.h | 12 +++++++++--- 5 files changed, 45 insertions(+), 15 deletions(-) diff --git a/Marlin/pins_ANET_10.h b/Marlin/pins_ANET_10.h index c13236a7c6..2ab92a3d9b 100644 --- a/Marlin/pins_ANET_10.h +++ b/Marlin/pins_ANET_10.h @@ -176,9 +176,15 @@ #define BTN_EN1 11 #define BTN_EN2 10 #define BTN_ENC 16 - #define ST7920_DELAY_1 DELAY_0_NOP - #define ST7920_DELAY_2 DELAY_1_NOP - #define ST7920_DELAY_3 DELAY_2_NOP + #ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_0_NOP + #endif + #ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_1_NOP + #endif + #ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_2_NOP + #endif #define STD_ENCODER_PULSES_PER_STEP 4 #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 #endif diff --git a/Marlin/pins_MELZI_CREALITY.h b/Marlin/pins_MELZI_CREALITY.h index 9f742f9ee3..da8ca1549b 100644 --- a/Marlin/pins_MELZI_CREALITY.h +++ b/Marlin/pins_MELZI_CREALITY.h @@ -54,9 +54,15 @@ #define FIL_RUNOUT_PIN -1 // Uses Beeper/LED Pin Pulled to GND // Alter timing for graphical display -#define ST7920_DELAY_1 DELAY_2_NOP -#define ST7920_DELAY_2 DELAY_2_NOP -#define ST7920_DELAY_3 DELAY_2_NOP +#ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_2_NOP +#endif +#ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_2_NOP +#endif +#ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_2_NOP +#endif #if ENABLED(MINIPANEL) #undef DOGLCD_CS diff --git a/Marlin/pins_MELZI_MALYAN.h b/Marlin/pins_MELZI_MALYAN.h index f2cb63b7ce..b11160f8e2 100644 --- a/Marlin/pins_MELZI_MALYAN.h +++ b/Marlin/pins_MELZI_MALYAN.h @@ -43,6 +43,12 @@ #define BTN_ENC 28 // Alter timing for graphical display -#define ST7920_DELAY_1 DELAY_2_NOP -#define ST7920_DELAY_2 DELAY_2_NOP -#define ST7920_DELAY_3 DELAY_2_NOP +#ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_2_NOP +#endif +#ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_2_NOP +#endif +#ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_2_NOP +#endif diff --git a/Marlin/pins_MELZI_TRONXY.h b/Marlin/pins_MELZI_TRONXY.h index c4741d1a51..7c66c50c60 100644 --- a/Marlin/pins_MELZI_TRONXY.h +++ b/Marlin/pins_MELZI_TRONXY.h @@ -50,6 +50,12 @@ #define BTN_EN2 11 #define BTN_ENC 26 -#define ST7920_DELAY_1 DELAY_0_NOP -#define ST7920_DELAY_2 DELAY_2_NOP -#define ST7920_DELAY_3 DELAY_0_NOP +#ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_0_NOP +#endif +#ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_2_NOP +#endif +#ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_0_NOP +#endif diff --git a/Marlin/pins_PRINTRBOARD_REVF.h b/Marlin/pins_PRINTRBOARD_REVF.h index 63b06bd670..48cf0fb2f6 100644 --- a/Marlin/pins_PRINTRBOARD_REVF.h +++ b/Marlin/pins_PRINTRBOARD_REVF.h @@ -243,9 +243,15 @@ //#define MISO 23 // 13 B3 ICSP-06 EXP2-05 // increase delays - #define ST7920_DELAY_1 DELAY_5_NOP - #define ST7920_DELAY_2 DELAY_5_NOP - #define ST7920_DELAY_3 DELAY_5_NOP + #ifndef ST7920_DELAY_1 + #define ST7920_DELAY_1 DELAY_5_NOP + #endif + #ifndef ST7920_DELAY_2 + #define ST7920_DELAY_2 DELAY_5_NOP + #endif + #ifndef ST7920_DELAY_3 + #define ST7920_DELAY_3 DELAY_5_NOP + #endif #else