From fd3f7b3473a16beaf195777b06435bc1cdfa5703 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 12 Jun 2021 12:30:29 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Clean=20up=20LPC1768=20SPI=20ini?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/LPC1768/HAL_SPI.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp index 99db15f6e9..29f9b43afe 100644 --- a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp +++ b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp @@ -66,11 +66,7 @@ #include - #ifndef HAL_SPI_SPEED - #define HAL_SPI_SPEED SPI_FULL_SPEED - #endif - - static uint8_t SPI_speed = HAL_SPI_SPEED; + static uint8_t SPI_speed = SPI_FULL_SPEED; static uint8_t spiTransfer(uint8_t b) { return swSpiTransfer(b, SPI_speed, SD_SCK_PIN, SD_MISO_PIN, SD_MOSI_PIN); @@ -106,15 +102,13 @@ #else - #ifndef HAL_SPI_SPEED - #ifdef SD_SPI_SPEED - #define HAL_SPI_SPEED SD_SPI_SPEED - #else - #define HAL_SPI_SPEED SPI_FULL_SPEED - #endif + #ifdef SD_SPI_SPEED + #define INIT_SPI_SPEED SD_SPI_SPEED + #else + #define INIT_SPI_SPEED SPI_FULL_SPEED #endif - void spiBegin() { spiInit(HAL_SPI_SPEED); } // Set up SCK, MOSI & MISO pins for SSP0 + void spiBegin() { spiInit(INIT_SPI_SPEED); } // Set up SCK, MOSI & MISO pins for SSP0 void spiInit(uint8_t spiRate) { #if SD_MISO_PIN == BOARD_SPI1_MISO_PIN