Skip to content

Commit

Permalink
Fix callbacks for P2P RX and TX timeout not being called
Browse files Browse the repository at this point in the history
  • Loading branch information
beegee-tokyo committed Feb 24, 2024
1 parent b6ad0aa commit 98ef65b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Arduino library for LoRa communication with Semtech SX126x chips. It is based on

# Release Notes

## V2.0.24 Fix P2P RX timeout callback fails
- Fix callbacks for P2P RX and TX timeout not being called

## V2.0.23 Add support for the Arduino Pico BSP
- Added support for the RAK11300 in [arduino-pico](https://github.com/earlephilhower/arduino-pico) BSP _**still experimental**_

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----
## Changelog
[Code releases](CHANGELOG.md)
- 2024-02-24
- Fix callbacks for P2P RX and TX timeout not being called
- 2023-12-14
- Seems RAK11300 and arduino-pico BSP is working now. _**still experimental**_
- 2023-12-12
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SX126x-Arduino",
"version": "2.0.23",
"version": "2.0.24",
"keywords": [
"lora",
"Semtech",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SX126x-Arduino
version=2.0.23
version=2.0.24
author=Bernd Giesecke <[email protected]>
maintainer=Bernd Giesecke <[email protected]>
sentence=Arduino library to use Semtech SX126x LoRa chips and modules to communicate
Expand Down
16 changes: 12 additions & 4 deletions src/radio/sx126x/radio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1040,8 +1040,8 @@ void RadioStandby(void)
void RadioRx(uint32_t timeout)
{
SX126xRXena();
SX126xSetDioIrqParams(IRQ_RADIO_ALL, // IRQ_RX_DONE | IRQ_RX_TX_TIMEOUT,
IRQ_RADIO_ALL, // IRQ_RX_DONE | IRQ_RX_TX_TIMEOUT,
SX126xSetDioIrqParams(IRQ_RX_DONE | IRQ_RX_TX_TIMEOUT | IRQ_HEADER_ERROR | IRQ_CRC_ERROR, // IRQ_RADIO_ALL
IRQ_RX_DONE | IRQ_RX_TX_TIMEOUT | IRQ_HEADER_ERROR | IRQ_CRC_ERROR, // IRQ_RADIO_ALL
IRQ_RADIO_NONE,
IRQ_RADIO_NONE);

Expand All @@ -1064,8 +1064,8 @@ void RadioRx(uint32_t timeout)

void RadioRxBoosted(uint32_t timeout)
{
SX126xSetDioIrqParams(IRQ_RADIO_ALL, // IRQ_RX_DONE | IRQ_RX_TX_TIMEOUT,
IRQ_RADIO_ALL, // IRQ_RX_DONE | IRQ_RX_TX_TIMEOUT,
SX126xSetDioIrqParams(IRQ_RX_DONE | IRQ_RX_TX_TIMEOUT | IRQ_HEADER_ERROR | IRQ_CRC_ERROR, // IRQ_RADIO_ALL
IRQ_RX_DONE | IRQ_RX_TX_TIMEOUT | IRQ_HEADER_ERROR | IRQ_CRC_ERROR, // IRQ_RADIO_ALL
IRQ_RADIO_NONE,
IRQ_RADIO_NONE);

Expand Down Expand Up @@ -1234,6 +1234,10 @@ void RadioOnTxTimeoutIrq(void)
TimerTxTimeout = true;
BoardEnableIrq();
TimerStop(&TxTimeoutTimer);

RadioBgIrqProcess();
RadioStandby();
RadioSleep();
}

void RadioOnRxTimeoutIrq(void)
Expand All @@ -1246,6 +1250,10 @@ void RadioOnRxTimeoutIrq(void)
TimerRxTimeout = true;
BoardEnableIrq();
TimerStop(&RxTimeoutTimer);

RadioBgIrqProcess();
RadioStandby();
RadioSleep();
}

#if defined NRF52_SERIES || defined ESP32 || defined ARDUINO_RAKWIRELESS_RAK11300
Expand Down

0 comments on commit 98ef65b

Please sign in to comment.