Skip to content

Commit

Permalink
[SX127x] Ignore SPI readout mismatch in FSK RX (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgromes committed Apr 15, 2021
1 parent d49a107 commit e27c3dd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/modules/SX127x/SX127x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,12 @@ bool SX127x::findChip(uint8_t ver) {
}

int16_t SX127x::setMode(uint8_t mode) {
return(_mod->SPIsetRegValue(SX127X_REG_OP_MODE, mode, 2, 0, 5));
uint8_t checkMask = 0xFF;
if((getActiveModem() == SX127X_FSK_OOK) && (mode == SX127X_RX)) {
// disable checking of RX bit in FSK RX mode, as it sometimes seem to fail (#276)
checkMask = 0xFE;
}
return(_mod->SPIsetRegValue(SX127X_REG_OP_MODE, mode, 2, 0, 5, checkMask));
}

int16_t SX127x::getActiveModem() {
Expand Down

0 comments on commit e27c3dd

Please sign in to comment.