From 846f30cd613738f07d2b62bb7ee05192a2a1659d Mon Sep 17 00:00:00 2001 From: Eric Marks Date: Wed, 29 Apr 2020 07:57:23 -0500 Subject: [PATCH] Fix Fifo Pointer in Continuous Mode In continuous mode we need to check and set the fifo pointer before every read, otherwise data may be lost. --- components/lora/COMPONENT_SX1272/SX1272_LoRaRadio.cpp | 1 + components/lora/COMPONENT_SX1276/SX1276_LoRaRadio.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/components/lora/COMPONENT_SX1272/SX1272_LoRaRadio.cpp b/components/lora/COMPONENT_SX1272/SX1272_LoRaRadio.cpp index 6826c123f5..baff137892 100644 --- a/components/lora/COMPONENT_SX1272/SX1272_LoRaRadio.cpp +++ b/components/lora/COMPONENT_SX1272/SX1272_LoRaRadio.cpp @@ -1826,6 +1826,7 @@ void SX1272_LoRaRadio::handle_dio0_irq() } _rf_settings.lora_packet_handler.size = read_register(REG_LR_RXNBBYTES); + write_to_register(REG_LR_FIFOADDRPTR, read_register(REG_LR_FIFORXCURRENTADDR)); read_fifo(_data_buffer, _rf_settings.lora_packet_handler.size); if (_rf_settings.lora.rx_continuous == false) { diff --git a/components/lora/COMPONENT_SX1276/SX1276_LoRaRadio.cpp b/components/lora/COMPONENT_SX1276/SX1276_LoRaRadio.cpp index 8edd0ab430..fed23c721d 100644 --- a/components/lora/COMPONENT_SX1276/SX1276_LoRaRadio.cpp +++ b/components/lora/COMPONENT_SX1276/SX1276_LoRaRadio.cpp @@ -1975,6 +1975,7 @@ void SX1276_LoRaRadio::handle_dio0_irq() } _rf_settings.lora_packet_handler.size = read_register(REG_LR_RXNBBYTES); + write_to_register(REG_LR_FIFOADDRPTR, read_register(REG_LR_FIFORXCURRENTADDR)); read_fifo(_data_buffer, _rf_settings.lora_packet_handler.size); if (_rf_settings.lora.rx_continuous == false) {