Skip to content

Commit 516348f

Browse files
ellenspLCh-77
authored andcommitted
🎨 Remove MKS custom pins, TinyBee cleanup (MarlinFirmware#24186)
1 parent 32aedde commit 516348f

File tree

2 files changed

+37
-62
lines changed

2 files changed

+37
-62
lines changed

Marlin/src/HAL/ESP32/u8g_esp32_spi.cpp

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,17 @@
2323
*/
2424
#ifdef ARDUINO_ARCH_ESP32
2525

26-
#include "../../inc/MarlinConfigPre.h"
26+
#include "../../inc/MarlinConfig.h"
2727

2828
#if EITHER(MKS_MINI_12864, FYSETC_MINI_12864_2_1)
2929

3030
#include <U8glib-HAL.h>
31-
#include "Arduino.h"
3231
#include "../shared/HAL_SPI.h"
3332
#include "HAL.h"
3433
#include "SPI.h"
3534

3635
static SPISettings spiConfig;
3736

38-
#define MDOGLCD_MOSI 23
39-
#define MDOGLCD_SCK 18
40-
#define MLCD_RESET_PIN 0
41-
#define MLCD_PINS_DC 4
42-
#define MDOGLCD_CS 21
43-
#define MDOGLCD_A0 4
4437

4538
#ifndef LCD_SPI_SPEED
4639
#ifdef SD_SPI_SPEED
@@ -61,24 +54,24 @@ uint8_t u8g_eps_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_pt
6154
case U8G_COM_MSG_STOP: break;
6255

6356
case U8G_COM_MSG_INIT:
64-
OUT_WRITE(MDOGLCD_CS, HIGH);
65-
OUT_WRITE(MDOGLCD_A0, HIGH);
66-
OUT_WRITE(MLCD_RESET_PIN, HIGH);
57+
OUT_WRITE(DOGLCD_CS, HIGH);
58+
OUT_WRITE(DOGLCD_A0, HIGH);
59+
OUT_WRITE(LCD_RESET_PIN, HIGH);
6760
u8g_Delay(5);
6861
spiBegin();
6962
spiInit(LCD_SPI_SPEED);
7063
break;
7164

7265
case U8G_COM_MSG_ADDRESS: /* define cmd (arg_val = 0) or data mode (arg_val = 1) */
73-
WRITE(MDOGLCD_A0, arg_val ? HIGH : LOW);
66+
WRITE(DOGLCD_A0, arg_val ? HIGH : LOW);
7467
break;
7568

7669
case U8G_COM_MSG_CHIP_SELECT: /* arg_val == 0 means HIGH level of U8G_PI_CS */
77-
WRITE(MDOGLCD_CS, arg_val ? LOW : HIGH);
70+
WRITE(DOGLCD_CS, arg_val ? LOW : HIGH);
7871
break;
7972

8073
case U8G_COM_MSG_RESET:
81-
WRITE(MLCD_RESET_PIN, arg_val);
74+
WRITE(LCD_RESET_PIN, arg_val);
8275
break;
8376

8477
case U8G_COM_MSG_WRITE_BYTE:

Marlin/src/pins/esp32/pins_MKS_TINYBEE.h

Lines changed: 30 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,7 @@
116116
//
117117
// ADC Reference Voltage
118118
//
119-
#define ADC_REFERENCE_VOLTAGE 2.5 // 2.5V reference VDDA
120-
121-
//
122-
// MicroSD card
123-
//
124-
#define SD_MOSI_PIN 23
125-
#define SD_MISO_PIN 19
126-
#define SD_SCK_PIN 18
127-
#define SDSS 5
128-
#define SD_DETECT_PIN 34 // IO34 default is SD_DET signal (Jump to SDDET)
129-
#define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers
119+
#define ADC_REFERENCE_VOLTAGE 2.5 // 2.5V reference VDDA
130120

131121
/**
132122
* ------ ------
@@ -157,56 +147,48 @@
157147
#define EXP2_09_PIN 18
158148
#define EXP2_10_PIN 19
159149

160-
#if HAS_WIRED_LCD
150+
//
151+
// MicroSD card
152+
//
153+
//#define SD_MOSI_PIN EXP2_05_PIN // uses esp32 default 23
154+
//#define SD_MISO_PIN EXP2_10_PIN // uses esp32 default 19
155+
//#define SD_SCK_PIN EXP2_09_PIN // uses esp32 default 18
156+
#define SDSS EXP2_07_PIN
157+
#define SD_DETECT_PIN EXP2_04_PIN // IO34 default is SD_DET signal (Jump to SDDET)
158+
#define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers
161159

162-
#define BEEPER_PIN 149
163-
#define BTN_ENC 13
164-
#define LCD_PINS_ENABLE 21
165-
#define LCD_PINS_RS 4
166-
#define BTN_EN1 14
167-
#define BTN_EN2 12
160+
#if HAS_WIRED_LCD
161+
#define BEEPER_PIN EXP1_10_PIN
162+
#define LCD_PINS_ENABLE EXP1_08_PIN
163+
#define LCD_PINS_RS EXP1_07_PIN
164+
#define BTN_ENC EXP1_09_PIN
165+
#define BTN_EN1 EXP2_08_PIN
166+
#define BTN_EN2 EXP2_06_PIN
168167
#define LCD_BACKLIGHT_PIN -1
169168

170-
// MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor)
171169
#if ENABLED(MKS_MINI_12864)
172-
173-
//#define LCD_BACKLIGHT_PIN -1
174-
//#define LCD_RESET_PIN -1
175-
#define DOGLCD_A0 15
176-
#define DOGLCD_CS 16
177-
//#define DOGLCD_SCK 19
178-
//#define DOGLCD_MOSI 23
179-
180-
// Required for MKS_MINI_12864 with this board
181-
//#define MKS_LCD12864B
182-
183-
#elif ENABLED(MKS_MINI_12864_V3)
184-
185-
#define LCD_PINS_DC EXP1_07_PIN
170+
// MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor)
171+
#define DOGLCD_CS EXP1_05_PIN
172+
#define DOGLCD_A0 EXP1_04_PIN
173+
#define LCD_RESET_PIN -1
174+
#elif ENABLED(FYSETC_MINI_12864_2_1)
175+
// MKS_MINI_12864_V3, BTT_MINI_12864_V1, FYSETC_MINI_12864_2_1
186176
#define DOGLCD_CS EXP1_08_PIN
187-
#define DOGLCD_A0 LCD_PINS_DC
188-
#define LCD_BACKLIGHT_PIN -1
177+
#define DOGLCD_A0 EXP1_07_PIN
189178
#define LCD_RESET_PIN EXP1_06_PIN
190179
#define NEOPIXEL_PIN EXP1_05_PIN
191-
#define DOGLCD_MOSI EXP2_05_PIN
192-
#define DOGLCD_SCK EXP2_09_PIN
193180
#if SD_CONNECTION_IS(ONBOARD)
194181
#define FORCE_SOFT_SPI
195182
#endif
196-
197-
#else // !MKS_MINI_12864
198-
199-
#define LCD_PINS_D4 0
183+
#else
184+
#define LCD_PINS_D4 EXP1_06_PIN
200185
#if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
201-
#define LCD_PINS_D5 16
202-
#define LCD_PINS_D6 15
203-
#define LCD_PINS_D7 17
186+
#define LCD_PINS_D5 EXP1_05_PIN
187+
#define LCD_PINS_D6 EXP1_04_PIN
188+
#define LCD_PINS_D7 EXP1_03_PIN
204189
#endif
205-
206190
#define BOARD_ST7920_DELAY_1 96
207191
#define BOARD_ST7920_DELAY_2 48
208192
#define BOARD_ST7920_DELAY_3 600
209-
210-
#endif // !MKS_MINI_12864
211-
193+
#endif
212194
#endif // HAS_WIRED_LCD

0 commit comments

Comments
 (0)