Fix STM32F1 SPI device init, MKS_LCD12864 (#19271)
This commit is contained in:
parent
563bd5b5bc
commit
24fbfae0fd
@ -40,6 +40,9 @@
|
|||||||
#include <boards.h>
|
#include <boards.h>
|
||||||
#include <wirish.h>
|
#include <wirish.h>
|
||||||
|
|
||||||
|
#include "../../inc/MarlinConfig.h"
|
||||||
|
#include "spi_pins.h"
|
||||||
|
|
||||||
/** Time in ms for DMA receive timeout */
|
/** Time in ms for DMA receive timeout */
|
||||||
#define DMA_TIMEOUT 100
|
#define DMA_TIMEOUT 100
|
||||||
|
|
||||||
@ -710,6 +713,6 @@ static spi_baud_rate determine_baud_rate(spi_dev *dev, uint32_t freq) {
|
|||||||
return baud_rates[i];
|
return baud_rates[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
SPIClass SPI(1);
|
SPIClass SPI(SPI_DEVICE);
|
||||||
|
|
||||||
#endif // __STM32F1__
|
#endif // __STM32F1__
|
||||||
|
@ -112,6 +112,7 @@ static const uint8_t u8g_dev_uc1701_mini12864_HAL_init_seq[] PROGMEM = {
|
|||||||
U8G_ESC_CS(1), // enable chip
|
U8G_ESC_CS(1), // enable chip
|
||||||
UC1701_ALL_PIX(0), // normal display
|
UC1701_ALL_PIX(0), // normal display
|
||||||
U8G_ESC_CS(0), // disable chip
|
U8G_ESC_CS(0), // disable chip
|
||||||
|
U8G_ESC_DLY(150), // delay 150 ms before sending any data
|
||||||
U8G_ESC_END // end of sequence
|
U8G_ESC_END // end of sequence
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -240,8 +240,6 @@ bool MarlinUI::detected() { return true; }
|
|||||||
|
|
||||||
// Initialize or re-initialize the LCD
|
// Initialize or re-initialize the LCD
|
||||||
void MarlinUI::init_lcd() {
|
void MarlinUI::init_lcd() {
|
||||||
#if DISABLED(MKS_LCD12864)
|
|
||||||
|
|
||||||
#if PIN_EXISTS(LCD_BACKLIGHT)
|
#if PIN_EXISTS(LCD_BACKLIGHT)
|
||||||
OUT_WRITE(LCD_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); // Illuminate after reset or right away
|
OUT_WRITE(LCD_BACKLIGHT_PIN, DISABLED(DELAYED_BACKLIGHT_INIT)); // Illuminate after reset or right away
|
||||||
#endif
|
#endif
|
||||||
@ -272,8 +270,6 @@ void MarlinUI::init_lcd() {
|
|||||||
TERN_(LCD_SCREEN_ROT_180, u8g.setRot180());
|
TERN_(LCD_SCREEN_ROT_180, u8g.setRot180());
|
||||||
TERN_(LCD_SCREEN_ROT_270, u8g.setRot270());
|
TERN_(LCD_SCREEN_ROT_270, u8g.setRot270());
|
||||||
|
|
||||||
#endif // !MKS_LCD12864
|
|
||||||
|
|
||||||
uxg_SetUtf8Fonts(g_fontinfo, COUNT(g_fontinfo));
|
uxg_SetUtf8Fonts(g_fontinfo, COUNT(g_fontinfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
|
|
||||||
//#define DISABLE_DEBUG
|
//#define DISABLE_DEBUG
|
||||||
#define DISABLE_JTAG
|
#define DISABLE_JTAG
|
||||||
#define ENABLE_SPI2
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// EEPROM
|
// EEPROM
|
||||||
@ -152,8 +151,6 @@
|
|||||||
#define DOGLCD_SCK PB13
|
#define DOGLCD_SCK PB13
|
||||||
#define DOGLCD_MOSI PB15
|
#define DOGLCD_MOSI PB15
|
||||||
|
|
||||||
#undef SHOW_BOOTSCREEN
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define LCD_PINS_D4 PA6
|
#define LCD_PINS_D4 PA6
|
||||||
|
@ -115,8 +115,6 @@
|
|||||||
#define DOGLCD_SCK PB13
|
#define DOGLCD_SCK PB13
|
||||||
#define DOGLCD_MOSI PB15
|
#define DOGLCD_MOSI PB15
|
||||||
|
|
||||||
#undef SHOW_BOOTSCREEN
|
|
||||||
|
|
||||||
#else // !MKS_MINI_12864
|
#else // !MKS_MINI_12864
|
||||||
|
|
||||||
#define LCD_PINS_D4 PA6
|
#define LCD_PINS_D4 PA6
|
||||||
|
@ -351,10 +351,6 @@
|
|||||||
#define DOGLCD_SCK PA5
|
#define DOGLCD_SCK PA5
|
||||||
#define DOGLCD_MOSI PA7
|
#define DOGLCD_MOSI PA7
|
||||||
|
|
||||||
// Required for MKS_MINI_12864 with this board
|
|
||||||
#define MKS_LCD12864B
|
|
||||||
#undef SHOW_BOOTSCREEN
|
|
||||||
|
|
||||||
#else // !MKS_MINI_12864
|
#else // !MKS_MINI_12864
|
||||||
|
|
||||||
#define LCD_PINS_D4 PE14
|
#define LCD_PINS_D4 PE14
|
||||||
|
Loading…
Reference in New Issue
Block a user