From bd58ac2dd50ce785ff73eefc3fa9e2f0c7ccc4e4 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Mon, 27 Apr 2020 03:13:47 -0700 Subject: [PATCH] Apply missed const& SPI optimization (#17734) Followup to eebb68cd7f --- Marlin/src/HAL/LPC1768/HAL_SPI.cpp | 2 +- Marlin/src/HAL/LPC1768/include/SPI.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp index a8a7279ffb8fe..a34037fde5900 100644 --- a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp +++ b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp @@ -213,7 +213,7 @@ void SPIClass::begin() { spiBegin(); } -void SPIClass::beginTransaction(SPISettings cfg) { +void SPIClass::beginTransaction(const SPISettings &cfg) { uint8_t spiRate; switch (cfg.spiRate()) { case 8000000: spiRate = 0; break; diff --git a/Marlin/src/HAL/LPC1768/include/SPI.h b/Marlin/src/HAL/LPC1768/include/SPI.h index 3bc0299b14d84..4e84c0efa5caf 100644 --- a/Marlin/src/HAL/LPC1768/include/SPI.h +++ b/Marlin/src/HAL/LPC1768/include/SPI.h @@ -31,7 +31,7 @@ class SPISettings { public: SPISettings(uint32_t speed, int, int) : spi_speed(speed) {}; - uint32_t spiRate() { return spi_speed; } + uint32_t spiRate() const { return spi_speed; } private: uint32_t spi_speed; };