Browse Source

Apply missed const& SPI optimization (#17734)

Followup to eebb68cd7f
Jason Smith 4 years ago
parent
commit
8f7f7f7c45
No account linked to committer's email address
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      Marlin/src/HAL/LPC1768/HAL_SPI.cpp
  2. 1
    1
      Marlin/src/HAL/LPC1768/include/SPI.h

+ 1
- 1
Marlin/src/HAL/LPC1768/HAL_SPI.cpp View File

@@ -213,7 +213,7 @@
213 213
 
214 214
 void SPIClass::begin() { spiBegin(); }
215 215
 
216
-void SPIClass::beginTransaction(SPISettings cfg) {
216
+void SPIClass::beginTransaction(const SPISettings &cfg) {
217 217
   uint8_t spiRate;
218 218
   switch (cfg.spiRate()) {
219 219
     case 8000000: spiRate = 0; break;

+ 1
- 1
Marlin/src/HAL/LPC1768/include/SPI.h View File

@@ -31,7 +31,7 @@
31 31
 class SPISettings {
32 32
   public:
33 33
     SPISettings(uint32_t speed, int, int) : spi_speed(speed) {};
34
-    uint32_t spiRate() { return spi_speed; }
34
+    uint32_t spiRate() const { return spi_speed; }
35 35
   private:
36 36
     uint32_t spi_speed;
37 37
 };

Loading…
Cancel
Save