From 66898849103c315e254350c59d64df378d771392 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 17 Mar 2018 02:40:20 -0500 Subject: [PATCH] Easier override of ST7920 LCD timing --- Marlin/src/pins/pins_ANET_10.h | 12 +++++++++--- Marlin/src/pins/pins_MELZI_CREALITY.h | 12 +++++++++--- Marlin/src/pins/pins_MELZI_MALYAN.h | 12 +++++++++--- Marlin/src/pins/pins_MELZI_TRONXY.h | 12 +++++++++--- Marlin/src/pins/pins_PRINTRBOARD_REVF.h | 12 +++++++++--- 5 files changed, 45 insertions(+), 15 deletions(-) diff --git a/Marlin/src/pins/pins_ANET_10.h b/Marlin/src/pins/pins_ANET_10.h index c13236a7c..2ab92a3d9 100644 --- a/Marlin/src/pins/pins_ANET_10.h +++ b/Marlin/src/pins/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/src/pins/pins_MELZI_CREALITY.h b/Marlin/src/pins/pins_MELZI_CREALITY.h index 9f742f9ee..da8ca1549 100644 --- a/Marlin/src/pins/pins_MELZI_CREALITY.h +++ b/Marlin/src/pins/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/src/pins/pins_MELZI_MALYAN.h b/Marlin/src/pins/pins_MELZI_MALYAN.h index f2cb63b7c..b11160f8e 100644 --- a/Marlin/src/pins/pins_MELZI_MALYAN.h +++ b/Marlin/src/pins/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/src/pins/pins_MELZI_TRONXY.h b/Marlin/src/pins/pins_MELZI_TRONXY.h index c4741d1a5..7c66c50c6 100644 --- a/Marlin/src/pins/pins_MELZI_TRONXY.h +++ b/Marlin/src/pins/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/src/pins/pins_PRINTRBOARD_REVF.h b/Marlin/src/pins/pins_PRINTRBOARD_REVF.h index 63b06bd67..48cf0fb2f 100644 --- a/Marlin/src/pins/pins_PRINTRBOARD_REVF.h +++ b/Marlin/src/pins/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