[CC1101] Fix getRSSI data source (#1121)
* [CC1101] Fix getRSSI data source * [CC1101] Fix packet mode not resetting directModeEnabled bool
This commit is contained in:
parent
e855636384
commit
a8b6c38488
2 changed files with 6 additions and 3 deletions
|
@ -1023,7 +1023,7 @@ int16_t CC1101::directMode(bool sync) {
|
||||||
SPIsendCommand(RADIOLIB_CC1101_CMD_IDLE);
|
SPIsendCommand(RADIOLIB_CC1101_CMD_IDLE);
|
||||||
|
|
||||||
int16_t state = 0;
|
int16_t state = 0;
|
||||||
this->directModeEnabled = sync;
|
this->directModeEnabled = true;
|
||||||
if(sync) {
|
if(sync) {
|
||||||
// set GDO0 and GDO2 mapping
|
// set GDO0 and GDO2 mapping
|
||||||
state |= SPIsetRegValue(RADIOLIB_CC1101_REG_IOCFG0, RADIOLIB_CC1101_GDOX_SERIAL_CLOCK , 5, 0);
|
state |= SPIsetRegValue(RADIOLIB_CC1101_REG_IOCFG0, RADIOLIB_CC1101_GDOX_SERIAL_CLOCK , 5, 0);
|
||||||
|
@ -1083,6 +1083,9 @@ int16_t CC1101::setPacketMode(uint8_t mode, uint16_t len) {
|
||||||
state = SPIsetRegValue(RADIOLIB_CC1101_REG_PKTLEN, len);
|
state = SPIsetRegValue(RADIOLIB_CC1101_REG_PKTLEN, len);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
|
// no longer in a direct mode
|
||||||
|
this->directModeEnabled = false;
|
||||||
|
|
||||||
// update the cached values
|
// update the cached values
|
||||||
this->packetLength = len;
|
this->packetLength = len;
|
||||||
this->packetLengthConfig = mode;
|
this->packetLengthConfig = mode;
|
||||||
|
|
|
@ -845,7 +845,7 @@ class CC1101: public PhysicalLayer {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Gets RSSI (Recorded Signal Strength Indicator) of the last received packet.
|
\brief Gets RSSI (Recorded Signal Strength Indicator) of the last received packet.
|
||||||
In asynchronous direct mode, returns the current RSSI level.
|
In direct or asynchronous direct mode, returns the current RSSI level.
|
||||||
\returns RSSI in dBm.
|
\returns RSSI in dBm.
|
||||||
*/
|
*/
|
||||||
float getRSSI() override;
|
float getRSSI() override;
|
||||||
|
@ -1003,7 +1003,7 @@ class CC1101: public PhysicalLayer {
|
||||||
|
|
||||||
bool promiscuous = false;
|
bool promiscuous = false;
|
||||||
bool crcOn = true;
|
bool crcOn = true;
|
||||||
bool directModeEnabled = true;
|
bool directModeEnabled = false;
|
||||||
|
|
||||||
int8_t power = RADIOLIB_CC1101_DEFAULT_POWER;
|
int8_t power = RADIOLIB_CC1101_DEFAULT_POWER;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue