Fix Cppcheck warnings (#684)

This commit is contained in:
Olivier
2016-12-10 12:46:52 -08:00
committed by Bruce Lacey
parent 8e1ef13804
commit 37881d56ba
6 changed files with 18 additions and 14 deletions
+5 -5
View File
@@ -156,7 +156,7 @@ LOCAL bool RFM95_initialise(const float frequency)
(void)RFM95_setRadioMode(RFM95_RADIO_MODE_STDBY);
const rfm95_modemConfig_t configuration = { MY_RFM95_MODEM_CONFIGRUATION };
RFM95_setModemRegisters(configuration);
RFM95_setModemRegisters(&configuration);
RFM95_setPreambleLength(RFM95_PREAMBLE_LENGTH);
RFM95_setFrequency(frequency);
// set power level
@@ -331,11 +331,11 @@ LOCAL bool RFM95_setTxPower(uint8_t powerLevel)
}
// Sets registers from a canned modem configuration structure
LOCAL void RFM95_setModemRegisters(const rfm95_modemConfig_t config)
LOCAL void RFM95_setModemRegisters(const rfm95_modemConfig_t* config)
{
RFM95_writeReg(RFM95_REG_1D_MODEM_CONFIG1, config.reg_1d);
RFM95_writeReg(RFM95_REG_1E_MODEM_CONFIG2, config.reg_1e);
RFM95_writeReg(RFM95_REG_26_MODEM_CONFIG3, config.reg_26);
RFM95_writeReg(RFM95_REG_1D_MODEM_CONFIG1, config->reg_1d);
RFM95_writeReg(RFM95_REG_1E_MODEM_CONFIG2, config->reg_1e);
RFM95_writeReg(RFM95_REG_26_MODEM_CONFIG3, config->reg_26);
}
LOCAL void RFM95_setPreambleLength(const uint16_t preambleLength)
+1 -1
View File
@@ -291,7 +291,7 @@ LOCAL uint8_t RFM95_getAddress(void);
* bandwidth, spreading factor etc.
* @param config See modemConfig_t and references therein
*/
LOCAL void RFM95_setModemRegisters(const rfm95_modemConfig_t config);
LOCAL void RFM95_setModemRegisters(const rfm95_modemConfig_t* config);
/**
* @brief Tests whether a new message is available
* @return True if a new, complete, error-free uncollected message is available to be retreived by @ref RFM95_recv()