Apply missed const& SPI optimization (#17734)

Followup to eebb68cd7f
This commit is contained in:
Jason Smith 2020-04-27 03:13:47 -07:00 committed by GitHub
parent c4d57462dc
commit 8f7f7f7c45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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;
};