[CC1101] Fix getRSSI data source (#1121)

* [CC1101] Fix getRSSI data source

* [CC1101] Fix packet mode not resetting directModeEnabled bool
cc1101-stream
Jack Hance 2024-06-12 10:46:10 -05:00 zatwierdzone przez GitHub
rodzic e855636384
commit a8b6c38488
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
2 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -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);
@ -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;

Wyświetl plik

@ -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;
@ -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;