From d70a4646f4337ea450457313b6c1133556a23cfc Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Wed, 25 Apr 2018 22:56:43 -0500
Subject: [PATCH] MKS OLED support for RUMBA

Based on #10519

Co-Authored-By: Alex <alex18881@users.noreply.github.com>
---
 Marlin/pins_RUMBA.h | 41 ++++++++++++++++++++++++++---------------
 1 file changed, 26 insertions(+), 15 deletions(-)

diff --git a/Marlin/pins_RUMBA.h b/Marlin/pins_RUMBA.h
index ffa6a26e47..e604301545 100644
--- a/Marlin/pins_RUMBA.h
+++ b/Marlin/pins_RUMBA.h
@@ -136,21 +136,6 @@
 #define KILL_PIN           46
 #define CASE_LIGHT_PIN     45
 
-//
-// LCD / Controller
-//
-#define SD_DETECT_PIN      49
-#define BEEPER_PIN         44
-#define LCD_PINS_RS        19
-#define LCD_PINS_ENABLE    42
-#define LCD_PINS_D4        18
-#define LCD_PINS_D5        38
-#define LCD_PINS_D6        41
-#define LCD_PINS_D7        40
-#define BTN_EN1            11
-#define BTN_EN2            12
-#define BTN_ENC            43
-
 //
 // M3/M4/M5 - Spindle/Laser Control
 //
@@ -163,3 +148,29 @@
 #ifndef SPINDLE_DIR_PIN
   #define SPINDLE_DIR_PIN          15
 #endif
+
+//
+// LCD / Controller
+//
+#define SD_DETECT_PIN      49
+#define BEEPER_PIN         44
+#define LCD_PINS_D7        40
+#define BTN_EN1            11
+#define BTN_EN2            12
+#define BTN_ENC            43
+
+#if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)
+  #define LCD_PINS_DC      38 // Set as output on init
+  #define LCD_PINS_RS      41 // Pull low for 1s to init
+  // DOGM SPI LCD Support
+  #define DOGLCD_CS        19
+  #define DOGLCD_MOSI      42
+  #define DOGLCD_SCK       18
+  #define DOGLCD_A0        LCD_PINS_DC
+#else
+  #define LCD_PINS_RS      19
+  #define LCD_PINS_ENABLE  42
+  #define LCD_PINS_D4      18
+  #define LCD_PINS_D5      38
+  #define LCD_PINS_D6      41
+#endif