Skip to content

Commit

Permalink
Apply missed const& SPI optimization (MarlinFirmware#17734)
Browse files Browse the repository at this point in the history
Followup to eebb68c
  • Loading branch information
sjasonsmith authored and Emmanuel Viala committed Aug 21, 2020
1 parent 6a9f596 commit bd58ac2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/HAL/LPC1768/HAL_SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/LPC1768/include/SPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit bd58ac2

Please sign in to comment.