Skip to content

Commit a3057d2

Browse files
committed
Make getI2CBufferSize constexpr
Compiler hint, can be computed at compile time.
1 parent 6f260b3 commit a3057d2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/SparkFun_External_EEPROM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void ExternalEEPROM::disablePollForWriteComplete()
115115
{
116116
settings.pollForWriteComplete = false;
117117
}
118-
uint16_t ExternalEEPROM::getI2CBufferSize()
118+
constexpr uint16_t ExternalEEPROM::getI2CBufferSize()
119119
{
120120
return I2C_BUFFER_LENGTH_TX;
121121
}

src/SparkFun_External_EEPROM.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class ExternalEEPROM
117117
uint8_t getPageWriteTime();
118118
void enablePollForWriteComplete(); //Most EEPROMs all I2C polling of when a write has completed
119119
void disablePollForWriteComplete();
120-
uint16_t getI2CBufferSize(); //Return the size of the TX buffer
120+
constexpr uint16_t getI2CBufferSize(); //Return the size of the TX buffer
121121

122122
//Functionality to 'get' and 'put' objects to and from EEPROM.
123123
template <typename T>

0 commit comments

Comments
 (0)