Skip to content

Commit fd6f9bf

Browse files
Travis HendricksonKimmo Vaisanen
authored andcommitted
BUGFIX: MODEM_LORA rx continuous was timing out
1 parent 444e725 commit fd6f9bf

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

SX126X/SX126X_LoRaRadio.cpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ void SX126X_LoRaRadio::set_rx_config(radio_modems_t modem,
906906
}
907907

908908
case MODEM_LORA: {
909-
_rx_timeout_in_symbols = symb_timeout;
909+
_rx_timeout_in_symbols = rx_continuous ? 0 : symb_timeout;
910910
_mod_params.modem_type = MODEM_LORA;
911911
_mod_params.params.lora.spreading_factor =
912912
(lora_spread_factors_t) datarate;
@@ -1002,15 +1002,18 @@ void SX126X_LoRaRadio::send(uint8_t *buffer, uint8_t size)
10021002

10031003
void SX126X_LoRaRadio::receive(void)
10041004
{
1005-
if (get_modem() == MODEM_LORA && _reception_mode != RECEPTION_MODE_CONTINUOUS) {
1006-
// Data-sheet Table 13-11: StopOnPreambParam
1007-
// We will use radio's internal timer to mark no reception. This behaviour
1008-
// is different from SX1272/SX1276 where we are relying on radio to stop
1009-
// at preamble detection.
1010-
// 0x00 means Timer will be stopped on SyncWord(FSK) or Header (LoRa) detection
1011-
// 0x01 means Timer is stopped on preamble detection
1012-
uint8_t stop_at_preamble = 0x01;
1013-
write_opmode_command(RADIO_SET_STOPRXTIMERONPREAMBLE, &stop_at_preamble, 1);
1005+
if (get_modem() == MODEM_LORA) {
1006+
if (_reception_mode != RECEPTION_MODE_CONTINUOUS) {
1007+
// Data-sheet Table 13-11: StopOnPreambParam
1008+
// We will use radio's internal timer to mark no reception. This behaviour
1009+
// is different from SX1272/SX1276 where we are relying on radio to stop
1010+
// at preamble detection.
1011+
// 0x00 means Timer will be stopped on SyncWord(FSK) or Header (LoRa) detection
1012+
// 0x01 means Timer is stopped on preamble detection
1013+
uint8_t stop_at_preamble = 0x01;
1014+
write_opmode_command(RADIO_SET_STOPRXTIMERONPREAMBLE, &stop_at_preamble, 1);
1015+
}
1016+
10141017
// Data-sheet 13.4.9 SetLoRaSymbNumTimeout
10151018
write_opmode_command(RADIO_SET_LORASYMBTIMEOUT, &_rx_timeout_in_symbols, 1);
10161019
}

0 commit comments

Comments
 (0)