Better handling of DELAY_NS and DELAY_US (#10716)
Co-Authored-By: ejtagle <ejtagle@hotmail.com>
This commit is contained in:
@ -177,13 +177,13 @@
|
||||
#define BTN_EN2 10
|
||||
#define BTN_ENC 16
|
||||
#ifndef ST7920_DELAY_1
|
||||
#define ST7920_DELAY_1 DELAY_0_NOP
|
||||
#define ST7920_DELAY_1 DELAY_NS(0)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_2
|
||||
#define ST7920_DELAY_2 DELAY_1_NOP
|
||||
#define ST7920_DELAY_2 DELAY_NS(63)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_3
|
||||
#define ST7920_DELAY_3 DELAY_2_NOP
|
||||
#define ST7920_DELAY_3 DELAY_NS(125)
|
||||
#endif
|
||||
#define STD_ENCODER_PULSES_PER_STEP 4
|
||||
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
|
||||
|
@ -55,13 +55,13 @@
|
||||
|
||||
// Alter timing for graphical display
|
||||
#ifndef ST7920_DELAY_1
|
||||
#define ST7920_DELAY_1 DELAY_2_NOP
|
||||
#define ST7920_DELAY_1 DELAY_NS(125)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_2
|
||||
#define ST7920_DELAY_2 DELAY_2_NOP
|
||||
#define ST7920_DELAY_2 DELAY_NS(125)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_3
|
||||
#define ST7920_DELAY_3 DELAY_2_NOP
|
||||
#define ST7920_DELAY_3 DELAY_NS(125)
|
||||
#endif
|
||||
|
||||
#if ENABLED(MINIPANEL)
|
||||
|
@ -44,11 +44,11 @@
|
||||
|
||||
// Alter timing for graphical display
|
||||
#ifndef ST7920_DELAY_1
|
||||
#define ST7920_DELAY_1 DELAY_2_NOP
|
||||
#define ST7920_DELAY_1 DELAY_NS(125)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_2
|
||||
#define ST7920_DELAY_2 DELAY_2_NOP
|
||||
#define ST7920_DELAY_2 DELAY_NS(125)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_3
|
||||
#define ST7920_DELAY_3 DELAY_2_NOP
|
||||
#define ST7920_DELAY_3 DELAY_NS(125)
|
||||
#endif
|
||||
|
@ -51,11 +51,11 @@
|
||||
#define BTN_ENC 26
|
||||
|
||||
#ifndef ST7920_DELAY_1
|
||||
#define ST7920_DELAY_1 DELAY_0_NOP
|
||||
#define ST7920_DELAY_1 DELAY_NS(0)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_2
|
||||
#define ST7920_DELAY_2 DELAY_2_NOP
|
||||
#define ST7920_DELAY_2 DELAY_NS(125)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_3
|
||||
#define ST7920_DELAY_3 DELAY_0_NOP
|
||||
#define ST7920_DELAY_3 DELAY_NS(0)
|
||||
#endif
|
||||
|
@ -244,13 +244,13 @@
|
||||
|
||||
// increase delays
|
||||
#ifndef ST7920_DELAY_1
|
||||
#define ST7920_DELAY_1 DELAY_5_NOP
|
||||
#define ST7920_DELAY_1 DELAY_NS(313)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_2
|
||||
#define ST7920_DELAY_2 DELAY_5_NOP
|
||||
#define ST7920_DELAY_2 DELAY_NS(313)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_3
|
||||
#define ST7920_DELAY_3 DELAY_5_NOP
|
||||
#define ST7920_DELAY_3 DELAY_NS(313)
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
@ -239,13 +239,13 @@
|
||||
#define BTN_EN2 30
|
||||
|
||||
#ifndef ST7920_DELAY_1
|
||||
#define ST7920_DELAY_1 DELAY_0_NOP
|
||||
#define ST7920_DELAY_1 DELAY_NS(0)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_2
|
||||
#define ST7920_DELAY_2 DELAY_3_NOP
|
||||
#define ST7920_DELAY_2 DELAY_NS(188)
|
||||
#endif
|
||||
#ifndef ST7920_DELAY_3
|
||||
#define ST7920_DELAY_3 DELAY_0_NOP
|
||||
#define ST7920_DELAY_3 DELAY_NS(0)
|
||||
#endif
|
||||
|
||||
#elif ENABLED(ZONESTAR_LCD) // For the Tronxy Melzi boards
|
||||
|
@ -176,19 +176,14 @@
|
||||
//
|
||||
// ST7920 Delays
|
||||
//
|
||||
|
||||
#define STM_NOP __asm__("nop\n\t")
|
||||
#define STM_DELAY_SHORT { STM_NOP; STM_NOP; STM_NOP; STM_NOP; }
|
||||
#define STM_DELAY_LONG { STM_DELAY_SHORT; STM_DELAY_SHORT; STM_NOP; STM_NOP; }
|
||||
|
||||
#ifndef ST7920_DELAY_1
|
||||
#define ST7920_DELAY_1 { STM_DELAY_SHORT; STM_DELAY_SHORT; }
|
||||
#define ST7920_DELAY_1 DELAY_NS(96)
|
||||
#endif
|
||||
|
||||
#ifndef ST7920_DELAY_2
|
||||
#define ST7920_DELAY_2 { STM_DELAY_SHORT; }
|
||||
#define ST7920_DELAY_2 DELAY_NS(48)
|
||||
#endif
|
||||
|
||||
#ifndef ST7920_DELAY_3
|
||||
#define ST7920_DELAY_3 { STM_DELAY_LONG; STM_DELAY_LONG; STM_DELAY_LONG; STM_DELAY_LONG; STM_DELAY_LONG; STM_DELAY_LONG; }
|
||||
#define ST7920_DELAY_3 DELAY_NS(715)
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user