Browse Source

Fix MKS MINI12864 on SKR 1.3 (#15836)

Marvin Sinister 5 years ago
parent
commit
8d157a4520

+ 5
- 5
Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp View File

130
 static uint8_t SPI_speed = 0;
130
 static uint8_t SPI_speed = 0;
131
 
131
 
132
 static void u8g_sw_spi_HAL_LPC1768_shift_out(uint8_t dataPin, uint8_t clockPin, uint8_t val) {
132
 static void u8g_sw_spi_HAL_LPC1768_shift_out(uint8_t dataPin, uint8_t clockPin, uint8_t val) {
133
-  #if ENABLED(FYSETC_MINI_12864)
133
+  #if EITHER(FYSETC_MINI_12864, MKS_MINI_12864)
134
     swSpiTransfer_mode_3(val, SPI_speed, clockPin, -1, dataPin);
134
     swSpiTransfer_mode_3(val, SPI_speed, clockPin, -1, dataPin);
135
   #else
135
   #else
136
     swSpiTransfer_mode_0(val, SPI_speed, clockPin, -1, dataPin);
136
     swSpiTransfer_mode_0(val, SPI_speed, clockPin, -1, dataPin);
158
       break;
158
       break;
159
 
159
 
160
     case U8G_COM_MSG_CHIP_SELECT:
160
     case U8G_COM_MSG_CHIP_SELECT:
161
-      #if ENABLED(FYSETC_MINI_12864)           // LCD SPI is running mode 3 while SD card is running mode 0
162
-        if (arg_val) {                         //   SCK idle state needs to be set to the proper idle state before
163
-                                               //   the next chip select goes active
164
-          u8g_SetPILevel(u8g, U8G_PI_SCK, 1);  // Set SCK to mode 3 idle state before CS goes active
161
+      #if EITHER(FYSETC_MINI_12864, MKS_MINI_12864)  // LCD SPI is running mode 3 while SD card is running mode 0
162
+        if (arg_val) {                               //   SCK idle state needs to be set to the proper idle state before
163
+                                                     //   the next chip select goes active
164
+          u8g_SetPILevel(u8g, U8G_PI_SCK, 1);        // Set SCK to mode 3 idle state before CS goes active
165
           u8g_SetPILevel(u8g, U8G_PI_CS, LOW);
165
           u8g_SetPILevel(u8g, U8G_PI_CS, LOW);
166
         }
166
         }
167
         else {
167
         else {

+ 5
- 3
Marlin/src/pins/lpc1768/pins_BIGTREE_SKR_V1.3.h View File

228
       #define DOGLCD_A0    P1_19
228
       #define DOGLCD_A0    P1_19
229
       #define DOGLCD_SCK   P0_15
229
       #define DOGLCD_SCK   P0_15
230
       #define DOGLCD_MOSI  P0_18
230
       #define DOGLCD_MOSI  P0_18
231
-      #define FORCE_SOFT_SPI
232
 
231
 
233
       #define LCD_BACKLIGHT_PIN -1
232
       #define LCD_BACKLIGHT_PIN -1
234
 
233
 
254
     #else // !FYSETC_MINI_12864
253
     #else // !FYSETC_MINI_12864
255
 
254
 
256
       #if ENABLED(MKS_MINI_12864)
255
       #if ENABLED(MKS_MINI_12864)
257
-        #define DOGLCD_CS  P1_21
258
-        #define DOGLCD_A0  P1_22
256
+        #define DOGLCD_CS    P1_21
257
+        #define DOGLCD_A0    P1_22
258
+        #define DOGLCD_SCK   P0_15
259
+        #define DOGLCD_MOSI  P0_18
260
+        #define FORCE_SOFT_SPI
259
       #endif
261
       #endif
260
 
262
 
261
       #if ENABLED(ULTIPANEL)
263
       #if ENABLED(ULTIPANEL)

Loading…
Cancel
Save