Browse Source
Improve U8G+SPI delay override (#18386)
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
vanilla_fb_2.0.x
Jason Smith
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with
206 additions and
109 deletions
-
Marlin/src/inc/Conditionals_LCD.h
-
Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp
-
Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h
-
Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h
-
Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h
-
Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h
-
Marlin/src/pins/sanguino/pins_MELZI_V2.h
-
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h
-
Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h
-
Marlin/src/pins/stm32f1/pins_GTM32_MINI.h
-
Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h
-
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h
-
Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h
-
Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h
-
Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h
-
Marlin/src/pins/stm32f4/pins_FYSETC_S6.h
-
Marlin/src/pins/stm32f4/pins_GENERIC_STM32F4.h
-
Marlin/src/pins/stm32f4/pins_LERDGE_K.h
-
Marlin/src/pins/stm32f4/pins_LERDGE_X.h
-
Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h
|
|
@ -106,15 +106,9 @@ |
|
|
|
#elif ENABLED(CR10_STOCKDISPLAY) |
|
|
|
|
|
|
|
#define IS_RRD_FG_SC |
|
|
|
#ifndef ST7920_DELAY_1 |
|
|
|
#define ST7920_DELAY_1 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#ifndef ST7920_DELAY_2 |
|
|
|
#define ST7920_DELAY_2 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#ifndef ST7920_DELAY_3 |
|
|
|
#define ST7920_DELAY_3 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(125) |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(125) |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(125) |
|
|
|
|
|
|
|
#elif ENABLED(MKS_12864OLED) |
|
|
|
|
|
|
|
|
|
@ -34,19 +34,30 @@ |
|
|
|
#include "ultralcd_st7920_u8glib_rrd_AVR.h" |
|
|
|
|
|
|
|
#ifndef ST7920_DELAY_1 |
|
|
|
#ifdef BOARD_ST7920_DELAY_1 |
|
|
|
#define ST7920_DELAY_1 BOARD_ST7920_DELAY_1 |
|
|
|
#else |
|
|
|
#define ST7920_DELAY_1 CPU_ST7920_DELAY_1 |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#ifndef ST7920_DELAY_2 |
|
|
|
#ifdef BOARD_ST7920_DELAY_2 |
|
|
|
#define ST7920_DELAY_2 BOARD_ST7920_DELAY_2 |
|
|
|
#else |
|
|
|
#define ST7920_DELAY_2 CPU_ST7920_DELAY_2 |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#ifndef ST7920_DELAY_3 |
|
|
|
#ifdef BOARD_ST7920_DELAY_3 |
|
|
|
#define ST7920_DELAY_3 BOARD_ST7920_DELAY_3 |
|
|
|
#else |
|
|
|
#define ST7920_DELAY_3 CPU_ST7920_DELAY_3 |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
// Optimize this code with -O3
|
|
|
|
#pragma GCC optimize (3) |
|
|
|
|
|
|
|
|
|
|
|
#ifdef ARDUINO_ARCH_STM32F1 |
|
|
|
#define ST7920_DAT(V) !!((V) & 0x80) |
|
|
|
#else |
|
|
|
|
|
@ -21,15 +21,6 @@ |
|
|
|
*/ |
|
|
|
#pragma once |
|
|
|
|
|
|
|
/**
|
|
|
|
* Override default LCD timing for Formbot T-Rex 2+ machines. |
|
|
|
* The long LCD cables and the routing near electrically noisy stepper motors |
|
|
|
* requires a slightly longer setup and hold time on the signals. |
|
|
|
*/ |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(200) |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(200) |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(200) |
|
|
|
|
|
|
|
/**
|
|
|
|
* Formbot pin assignments |
|
|
|
*/ |
|
|
@ -205,3 +196,15 @@ |
|
|
|
#define LCD_PINS_D6 27 |
|
|
|
#define LCD_PINS_D7 29 |
|
|
|
#endif |
|
|
|
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(200) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(200) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(200) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
@ -37,10 +37,16 @@ |
|
|
|
|
|
|
|
// Alter timing for graphical display
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
#include "pins_MELZI.h" |
|
|
|
|
|
|
|
|
|
@ -29,10 +29,16 @@ |
|
|
|
|
|
|
|
// Alter timing for graphical display
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
#include "pins_MELZI.h" |
|
|
|
|
|
|
|
|
|
@ -28,10 +28,16 @@ |
|
|
|
#define BOARD_INFO_NAME "Melzi (Tronxy)" |
|
|
|
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(0) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(0) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
#include "pins_MELZI.h" |
|
|
|
|
|
|
|
|
|
@ -24,10 +24,16 @@ |
|
|
|
|
|
|
|
#define BOARD_INFO_NAME "Melzi V2" |
|
|
|
|
|
|
|
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) |
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(0) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(188) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(0) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
#include "pins_MELZI.h" |
|
|
|
|
|
@ -172,6 +172,18 @@ |
|
|
|
|
|
|
|
#endif // !FYSETC_MINI_12864
|
|
|
|
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#endif // HAS_SPI_LCD
|
|
|
@ -203,9 +215,3 @@ |
|
|
|
#endif |
|
|
|
#define ON_BOARD_SPI_DEVICE 1 // SPI1
|
|
|
|
#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card
|
|
|
|
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(125) |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(125) |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
|
|
@ -143,10 +143,16 @@ |
|
|
|
|
|
|
|
// Alter timing for graphical display
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
//
|
|
|
|
// Camera
|
|
|
|
|
|
@ -159,10 +159,16 @@ |
|
|
|
#endif |
|
|
|
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(96) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(48) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(715) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
#endif // HAS_SPI_LCD
|
|
|
|
|
|
|
|
|
|
@ -159,10 +159,16 @@ |
|
|
|
#endif |
|
|
|
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(96) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(48) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(715) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
#endif // HAS_SPI_LCD
|
|
|
|
|
|
|
|
|
|
@ -111,6 +111,18 @@ |
|
|
|
|
|
|
|
#endif // !MKS_MINI_12864
|
|
|
|
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
#endif // HAS_SPI_LCD
|
|
|
|
|
|
|
|
// Motor current PWM pins
|
|
|
@ -129,9 +141,3 @@ |
|
|
|
#define MISO_PIN P1B4 |
|
|
|
#define MOSI_PIN P1B5 |
|
|
|
#define SS_PIN PA15 |
|
|
|
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(125) |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(125) |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(125) |
|
|
|
#endif |
|
|
|
|
|
@ -237,10 +237,16 @@ |
|
|
|
|
|
|
|
// Alter timing for graphical display
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(96) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(48) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(600) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
#endif // HAS_SPI_LCD
|
|
|
|
|
|
|
|
|
|
@ -328,9 +328,10 @@ |
|
|
|
#define LCD_PINS_ENABLE PG5 |
|
|
|
#define LCD_PINS_D4 PG7 |
|
|
|
|
|
|
|
//#undef ST7920_DELAY_1
|
|
|
|
//#undef ST7920_DELAY_2
|
|
|
|
//#undef ST7920_DELAY_3
|
|
|
|
// CR10_STOCKDISPLAY default timing is too fast
|
|
|
|
#undef BOARD_ST7920_DELAY_1 |
|
|
|
#undef BOARD_ST7920_DELAY_2 |
|
|
|
#undef BOARD_ST7920_DELAY_3 |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
@ -377,10 +378,16 @@ |
|
|
|
|
|
|
|
// Alter timing for graphical display
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(96) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(48) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(600) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
//#define DOGLCD_CS PB12
|
|
|
|
//#define DOGLCD_A0 PA8
|
|
|
|
|
|
@ -275,11 +275,10 @@ |
|
|
|
#define LCD_PINS_ENABLE PG7 |
|
|
|
#define LCD_PINS_D4 PG3 |
|
|
|
|
|
|
|
// CR10_Stock Display needs a different delay setting on SKR PRO v1.1, so undef it here.
|
|
|
|
// It will be defined again at the #HAS_GRAPHICAL_LCD section below.
|
|
|
|
#undef ST7920_DELAY_1 |
|
|
|
#undef ST7920_DELAY_2 |
|
|
|
#undef ST7920_DELAY_3 |
|
|
|
// CR10_STOCKDISPLAY default timing is too fast
|
|
|
|
#undef BOARD_ST7920_DELAY_1 |
|
|
|
#undef BOARD_ST7920_DELAY_2 |
|
|
|
#undef BOARD_ST7920_DELAY_3 |
|
|
|
|
|
|
|
#elif ENABLED(MKS_MINI_12864) |
|
|
|
#define DOGLCD_A0 PG6 |
|
|
@ -328,10 +327,16 @@ |
|
|
|
|
|
|
|
// Alter timing for graphical display
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(96) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(48) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(600) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
#endif // HAS_SPI_LCD
|
|
|
|
|
|
|
|
|
|
@ -191,11 +191,10 @@ |
|
|
|
#define LCD_PINS_ENABLE PD1 |
|
|
|
#define LCD_PINS_D4 PC12 |
|
|
|
|
|
|
|
// CR10_Stock Display needs a different delay setting on SKR PRO v1.1, so undef it here.
|
|
|
|
// It will be defined again at the #HAS_GRAPHICAL_LCD section below.
|
|
|
|
#undef ST7920_DELAY_1 |
|
|
|
#undef ST7920_DELAY_2 |
|
|
|
#undef ST7920_DELAY_3 |
|
|
|
// CR10_STOCKDISPLAY default timing is too fast
|
|
|
|
#undef BOARD_ST7920_DELAY_1 |
|
|
|
#undef BOARD_ST7920_DELAY_2 |
|
|
|
#undef BOARD_ST7920_DELAY_3 |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
|
|
@ -185,7 +185,13 @@ |
|
|
|
// ST7920 Delays
|
|
|
|
//
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(96) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(48) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(715) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
@ -173,7 +173,13 @@ |
|
|
|
// ST7920 Delays
|
|
|
|
//
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(96) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(48) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(715) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
@ -170,7 +170,13 @@ |
|
|
|
// ST7920 Delays
|
|
|
|
//
|
|
|
|
#if HAS_GRAPHICAL_LCD |
|
|
|
#ifndef BOARD_ST7920_DELAY_1 |
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(96) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_2 |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(48) |
|
|
|
#endif |
|
|
|
#ifndef BOARD_ST7920_DELAY_3 |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(715) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
@ -246,7 +246,7 @@ |
|
|
|
//#define MOSI 22 // 12 B2 ICSP-03 EXP2-05
|
|
|
|
//#define MISO 23 // 13 B3 ICSP-06 EXP2-05
|
|
|
|
|
|
|
|
// increase delays
|
|
|
|
// Alter timing for graphical display
|
|
|
|
#define BOARD_ST7920_DELAY_1 DELAY_NS(313) |
|
|
|
#define BOARD_ST7920_DELAY_2 DELAY_NS(313) |
|
|
|
#define BOARD_ST7920_DELAY_3 DELAY_NS(313) |
|
|
|