From bda6e220b6fcb39fca94eb1637bbf1721125d60e Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 23 Apr 2023 22:03:12 +0200 Subject: [PATCH] [CC1101] Fixed variable shadowing --- src/modules/CC1101/CC1101.cpp | 10 +++++----- src/modules/CC1101/CC1101.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/modules/CC1101/CC1101.cpp b/src/modules/CC1101/CC1101.cpp index d12251bd..f392a4cc 100644 --- a/src/modules/CC1101/CC1101.cpp +++ b/src/modules/CC1101/CC1101.cpp @@ -10,7 +10,7 @@ Module* CC1101::getMod() { 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 this->mod->SPIreadCommand = RADIOLIB_CC1101_CMD_READ; 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); // configure default TX output power - state = setOutputPower(power); + state = setOutputPower(pwr); RADIOLIB_ASSERT(state); // set default packet length mode @@ -598,7 +598,7 @@ int16_t CC1101::getFrequencyDeviation(float *freqDev) { return(RADIOLIB_ERR_NONE); } -int16_t CC1101::setOutputPower(int8_t power) { +int16_t CC1101::setOutputPower(int8_t pwr) { // round to the known frequency settings uint8_t f; if(this->frequency < 374.0) { @@ -626,7 +626,7 @@ int16_t CC1101::setOutputPower(int8_t power) { {0xC2, 0xC0, 0xC2, 0xC0}}; uint8_t powerRaw; - switch(power) { + switch(pwr) { case -30: powerRaw = paTable[0][f]; break; @@ -656,7 +656,7 @@ int16_t CC1101::setOutputPower(int8_t power) { } // store the value - this->power = power; + this->power = pwr; if(this->modulation == RADIOLIB_CC1101_MOD_FORMAT_ASK_OOK){ // Amplitude modulation: diff --git a/src/modules/CC1101/CC1101.h b/src/modules/CC1101/CC1101.h index 7654173b..8dbf4326 100644 --- a/src/modules/CC1101/CC1101.h +++ b/src/modules/CC1101/CC1101.h @@ -552,7 +552,7 @@ class CC1101: public PhysicalLayer { \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 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. \returns \ref status_codes */ @@ -561,7 +561,7 @@ class CC1101: public PhysicalLayer { float br = RADIOLIB_CC1101_DEFAULT_BR, float freqDev = RADIOLIB_CC1101_DEFAULT_FREQDEV, 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); /*! @@ -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. - \param power Output power to be set in dBm. + \param pwr Output power to be set in dBm. \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.