Skip to content

Commit

Permalink
add chip revision number for SX123xH
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Jan 23, 2025
1 parent bedab1a commit 5979a2a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/modules/SX123x/SX1231.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ int16_t SX1231::begin(float freq, float br, float freqDev, float rxBw, int8_t po
bool flagFound = false;
while((i < 10) && !flagFound) {
int16_t version = getChipVersion();
if((version == RADIOLIB_SX123X_CHIP_REVISION_2_A) || (version == RADIOLIB_SX123X_CHIP_REVISION_2_B) || (version == RADIOLIB_SX123X_CHIP_REVISION_2_C)) {
if((version == RADIOLIB_SX123X_CHIP_REVISION_2_A) ||
(version == RADIOLIB_SX123X_CHIP_REVISION_2_B) ||
(version == RADIOLIB_SX123X_CHIP_REVISION_2_C) ||
(version == RADIOLIB_SX123X_CHIP_REVISION_2_D)) {
flagFound = true;
this->chipRevision = version;
} else {
Expand Down
1 change: 1 addition & 0 deletions src/modules/SX123x/SX1231.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define RADIOLIB_SX123X_CHIP_REVISION_2_A 0x21
#define RADIOLIB_SX123X_CHIP_REVISION_2_B 0x22
#define RADIOLIB_SX123X_CHIP_REVISION_2_C 0x23
#define RADIOLIB_SX123X_CHIP_REVISION_2_D 0x24

// RADIOLIB_SX1231 specific register map
#define RADIOLIB_SX1231_REG_TEST_OOK 0x6E
Expand Down
5 changes: 4 additions & 1 deletion src/modules/SX123x/SX1233.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ int16_t SX1233::begin(float freq, float br, float freqDev, float rxBw, int8_t po
bool flagFound = false;
while((i < 10) && !flagFound) {
int16_t version = getChipVersion();
if((version == RADIOLIB_SX123X_CHIP_REVISION_2_A) || (version == RADIOLIB_SX123X_CHIP_REVISION_2_B) || (version == RADIOLIB_SX123X_CHIP_REVISION_2_C)) {
if((version == RADIOLIB_SX123X_CHIP_REVISION_2_A) ||
(version == RADIOLIB_SX123X_CHIP_REVISION_2_B) ||
(version == RADIOLIB_SX123X_CHIP_REVISION_2_C) ||
(version == RADIOLIB_SX123X_CHIP_REVISION_2_D)) {
flagFound = true;
this->chipRevision = version;
} else {
Expand Down

0 comments on commit 5979a2a

Please sign in to comment.