Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CC1101] Fix getRSSI data source #1121

Merged
merged 2 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/modules/CC1101/CC1101.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ int16_t CC1101::directMode(bool sync) {
SPIsendCommand(RADIOLIB_CC1101_CMD_IDLE);

int16_t state = 0;
this->directModeEnabled = sync;
this->directModeEnabled = true;
if(sync) {
// set GDO0 and GDO2 mapping
state |= SPIsetRegValue(RADIOLIB_CC1101_REG_IOCFG0, RADIOLIB_CC1101_GDOX_SERIAL_CLOCK , 5, 0);
Expand Down Expand Up @@ -1083,6 +1083,9 @@ int16_t CC1101::setPacketMode(uint8_t mode, uint16_t len) {
state = SPIsetRegValue(RADIOLIB_CC1101_REG_PKTLEN, len);
RADIOLIB_ASSERT(state);

// no longer in a direct mode
this->directModeEnabled = false;

// update the cached values
this->packetLength = len;
this->packetLengthConfig = mode;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/CC1101/CC1101.h
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ class CC1101: public PhysicalLayer {

/*!
\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.
*/
float getRSSI() override;
Expand Down Expand Up @@ -1003,7 +1003,7 @@ class CC1101: public PhysicalLayer {

bool promiscuous = false;
bool crcOn = true;
bool directModeEnabled = true;
bool directModeEnabled = false;

int8_t power = RADIOLIB_CC1101_DEFAULT_POWER;

Expand Down
Loading