Skip to content

Commit ab05087

Browse files
committed
🎨 Clean up LPC1768 SPI init
1 parent 707a040 commit ab05087

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

Marlin/src/HAL/LPC1768/HAL_SPI.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,7 @@
6666

6767
#include <SoftwareSPI.h>
6868

69-
#ifndef HAL_SPI_SPEED
70-
#define HAL_SPI_SPEED SPI_FULL_SPEED
71-
#endif
72-
73-
static uint8_t SPI_speed = HAL_SPI_SPEED;
69+
static uint8_t SPI_speed = SPI_FULL_SPEED;
7470

7571
static uint8_t spiTransfer(uint8_t b) {
7672
return swSpiTransfer(b, SPI_speed, SD_SCK_PIN, SD_MISO_PIN, SD_MOSI_PIN);
@@ -106,15 +102,13 @@
106102

107103
#else
108104

109-
#ifndef HAL_SPI_SPEED
110-
#ifdef SD_SPI_SPEED
111-
#define HAL_SPI_SPEED SD_SPI_SPEED
112-
#else
113-
#define HAL_SPI_SPEED SPI_FULL_SPEED
114-
#endif
105+
#ifdef SD_SPI_SPEED
106+
#define INIT_SPI_SPEED SD_SPI_SPEED
107+
#else
108+
#define INIT_SPI_SPEED SPI_FULL_SPEED
115109
#endif
116110

117-
void spiBegin() { spiInit(HAL_SPI_SPEED); } // Set up SCK, MOSI & MISO pins for SSP0
111+
void spiBegin() { spiInit(INIT_SPI_SPEED); } // Set up SCK, MOSI & MISO pins for SSP0
118112

119113
void spiInit(uint8_t spiRate) {
120114
#if SD_MISO_PIN == BOARD_SPI1_MISO_PIN

0 commit comments

Comments
 (0)