[CC1101] Fixed variable shadowing
This commit is contained in:
parent
c5a3c4d361
commit
bda6e220b6
2 changed files with 9 additions and 9 deletions
|
@ -10,7 +10,7 @@ Module* CC1101::getMod() {
|
||||||
return(this->mod);
|
return(this->mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t CC1101::begin(float freq, float br, float freqDev, float rxBw, int8_t power, uint8_t preambleLength) {
|
int16_t CC1101::begin(float freq, float br, float freqDev, float rxBw, int8_t pwr, uint8_t preambleLength) {
|
||||||
// set module properties
|
// set module properties
|
||||||
this->mod->SPIreadCommand = RADIOLIB_CC1101_CMD_READ;
|
this->mod->SPIreadCommand = RADIOLIB_CC1101_CMD_READ;
|
||||||
this->mod->SPIwriteCommand = RADIOLIB_CC1101_CMD_WRITE;
|
this->mod->SPIwriteCommand = RADIOLIB_CC1101_CMD_WRITE;
|
||||||
|
@ -60,7 +60,7 @@ int16_t CC1101::begin(float freq, float br, float freqDev, float rxBw, int8_t po
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
// configure default TX output power
|
// configure default TX output power
|
||||||
state = setOutputPower(power);
|
state = setOutputPower(pwr);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
// set default packet length mode
|
// set default packet length mode
|
||||||
|
@ -598,7 +598,7 @@ int16_t CC1101::getFrequencyDeviation(float *freqDev) {
|
||||||
return(RADIOLIB_ERR_NONE);
|
return(RADIOLIB_ERR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t CC1101::setOutputPower(int8_t power) {
|
int16_t CC1101::setOutputPower(int8_t pwr) {
|
||||||
// round to the known frequency settings
|
// round to the known frequency settings
|
||||||
uint8_t f;
|
uint8_t f;
|
||||||
if(this->frequency < 374.0) {
|
if(this->frequency < 374.0) {
|
||||||
|
@ -626,7 +626,7 @@ int16_t CC1101::setOutputPower(int8_t power) {
|
||||||
{0xC2, 0xC0, 0xC2, 0xC0}};
|
{0xC2, 0xC0, 0xC2, 0xC0}};
|
||||||
|
|
||||||
uint8_t powerRaw;
|
uint8_t powerRaw;
|
||||||
switch(power) {
|
switch(pwr) {
|
||||||
case -30:
|
case -30:
|
||||||
powerRaw = paTable[0][f];
|
powerRaw = paTable[0][f];
|
||||||
break;
|
break;
|
||||||
|
@ -656,7 +656,7 @@ int16_t CC1101::setOutputPower(int8_t power) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// store the value
|
// store the value
|
||||||
this->power = power;
|
this->power = pwr;
|
||||||
|
|
||||||
if(this->modulation == RADIOLIB_CC1101_MOD_FORMAT_ASK_OOK){
|
if(this->modulation == RADIOLIB_CC1101_MOD_FORMAT_ASK_OOK){
|
||||||
// Amplitude modulation:
|
// Amplitude modulation:
|
||||||
|
|
|
@ -552,7 +552,7 @@ class CC1101: public PhysicalLayer {
|
||||||
\param br Bit rate to be used in kbps. Defaults to 4.8 kbps.
|
\param br Bit rate to be used in kbps. Defaults to 4.8 kbps.
|
||||||
\param freqDev Frequency deviation from carrier frequency in kHz Defaults to 5.0 kHz.
|
\param freqDev Frequency deviation from carrier frequency in kHz Defaults to 5.0 kHz.
|
||||||
\param rxBw Receiver bandwidth in kHz. Defaults to 135.0 kHz.
|
\param rxBw Receiver bandwidth in kHz. Defaults to 135.0 kHz.
|
||||||
\param power Output power in dBm. Defaults to 10 dBm.
|
\param pwr Output power in dBm. Defaults to 10 dBm.
|
||||||
\param preambleLength Preamble Length in bits. Defaults to 16 bits.
|
\param preambleLength Preamble Length in bits. Defaults to 16 bits.
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
|
@ -561,7 +561,7 @@ class CC1101: public PhysicalLayer {
|
||||||
float br = RADIOLIB_CC1101_DEFAULT_BR,
|
float br = RADIOLIB_CC1101_DEFAULT_BR,
|
||||||
float freqDev = RADIOLIB_CC1101_DEFAULT_FREQDEV,
|
float freqDev = RADIOLIB_CC1101_DEFAULT_FREQDEV,
|
||||||
float rxBw = RADIOLIB_CC1101_DEFAULT_RXBW,
|
float rxBw = RADIOLIB_CC1101_DEFAULT_RXBW,
|
||||||
int8_t power = RADIOLIB_CC1101_DEFAULT_POWER,
|
int8_t pwr = RADIOLIB_CC1101_DEFAULT_POWER,
|
||||||
uint8_t preambleLength = RADIOLIB_CC1101_DEFAULT_PREAMBLELEN);
|
uint8_t preambleLength = RADIOLIB_CC1101_DEFAULT_PREAMBLELEN);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -740,10 +740,10 @@ class CC1101: public PhysicalLayer {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets output power. Allowed values are -30, -20, -15, -10, 0, 5, 7 or 10 dBm.
|
\brief Sets output power. Allowed values are -30, -20, -15, -10, 0, 5, 7 or 10 dBm.
|
||||||
\param power Output power to be set in dBm.
|
\param pwr Output power to be set in dBm.
|
||||||
\returns \ref status_codes
|
\returns \ref status_codes
|
||||||
*/
|
*/
|
||||||
int16_t setOutputPower(int8_t power);
|
int16_t setOutputPower(int8_t pwr);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Sets 16-bit sync word as a two byte value.
|
\brief Sets 16-bit sync word as a two byte value.
|
||||||
|
|
Loading…
Add table
Reference in a new issue