SPI and pins cleanup
This commit is contained in:
@ -23,12 +23,14 @@
|
||||
#if BOTH(HAS_MARLINUI_U8GLIB, FORCE_SOFT_SPI)
|
||||
|
||||
#include <U8glib.h>
|
||||
#include "../../shared/HAL_SPI.h"
|
||||
|
||||
#undef SPI_SPEED
|
||||
#define SPI_SPEED 0 // Fastest
|
||||
//#define SPI_SPEED 2 // Slower
|
||||
#ifndef LCD_SPI_SPEED
|
||||
#define LCD_SPI_SPEED SPI_FULL_SPEED // Fastest
|
||||
//#define LCD_SPI_SPEED SPI_QUARTER_SPEED // Slower
|
||||
#endif
|
||||
|
||||
static uint8_t SPI_speed = SPI_SPEED;
|
||||
static uint8_t SPI_speed = LCD_SPI_SPEED;
|
||||
|
||||
static inline uint8_t swSpiTransfer_mode_0(uint8_t b, const uint8_t spi_speed, const pin_t miso_pin=-1) {
|
||||
LOOP_L_N(i, 8) {
|
||||
@ -104,7 +106,7 @@ static uint8_t swSpiInit(const uint8_t spi_speed) {
|
||||
uint8_t u8g_com_HAL_STM32F1_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) {
|
||||
switch (msg) {
|
||||
case U8G_COM_MSG_INIT:
|
||||
SPI_speed = swSpiInit(SPI_SPEED);
|
||||
SPI_speed = swSpiInit(LCD_SPI_SPEED);
|
||||
break;
|
||||
|
||||
case U8G_COM_MSG_STOP:
|
||||
|
@ -37,7 +37,7 @@
|
||||
#define TOUCH_SCK_PIN SCK_PIN
|
||||
#endif
|
||||
#ifndef TOUCH_CS_PIN
|
||||
#define TOUCH_CS_PIN CS_PIN
|
||||
#define TOUCH_CS_PIN SS_PIN
|
||||
#endif
|
||||
#ifndef TOUCH_INT_PIN
|
||||
#define TOUCH_INT_PIN -1
|
||||
|
Reference in New Issue
Block a user