MCP4725: Remove erroneous const keyword from parameter

Previously, when MCP4725_EXTENDED was defined, compilation of the library failed:

E:\arduino\libraries\MCP4725\MCP4725.cpp: In member function 'int MCP4725::writeRegisterMode(uint16_t, uint8_t)':

E:\arduino\libraries\MCP4725\MCP4725.cpp:195:9: error: assignment of read-only parameter 'reg'

     reg = reg | (_powerDownMode << 1);

         ^
This commit is contained in:
per1234 2018-10-17 23:48:42 -07:00
parent dee30a3f5b
commit 04610471c5
2 changed files with 2 additions and 2 deletions

View File

@ -187,7 +187,7 @@ bool MCP4725::RDY()
// PAGE 19 DATASHEET
// reg = MCP4725_DAC | MCP4725_EEPROM
int MCP4725::writeRegisterMode(const uint16_t value, const uint8_t reg)
int MCP4725::writeRegisterMode(const uint16_t value, uint8_t reg)
{
uint8_t h = (value / 16);
uint8_t l = (value & 0x0F) << 4;

View File

@ -82,7 +82,7 @@ private:
int writeFastMode(const uint16_t value);
#ifdef MCP4725_EXTENDED
int writeRegisterMode(const uint16_t value, const uint8_t reg);
int writeRegisterMode(const uint16_t value, uint8_t reg);
uint8_t readRegister(uint8_t* buffer, const uint8_t length);
#endif