1
Diff: radio_sx126x.cpp
- Revision:
- 11:5111788c4298
- Parent:
- 7:ba81f66e56d1
- Child:
- 13:a354f82d12d9
--- a/radio_sx126x.cpp Thu Dec 13 18:10:28 2018 -0800 +++ b/radio_sx126x.cpp Fri May 17 17:05:08 2019 -0700 @@ -41,6 +41,7 @@ const RadioEvents_t* RadioEvents; PacketParams_t Radio::pp; RadioModems_t Radio::_m_; +uint8_t Radio::loraTimeoutSymbols; #if defined(TARGET_FF_MORPHO) && !defined(TARGET_DISCO_L072CZ_LRWAN1) DigitalOut pc3(PC_3); // debug RX indication, for nucleo boards @@ -72,10 +73,18 @@ #ifdef RX_INDICATION RX_INDICATION = 1; #endif - if (timeout == 0) + if (timeout == 0) { + uint8_t symbs = 0; + if (radio.getPacketType() == PACKET_TYPE_LORA) // shut off timeout + radio.xfer(OPCODE_SET_LORA_SYMBOL_TIMEOUT, 1, 0, &symbs); + radio.start_rx(RX_TIMEOUT_CONTINUOUS); - else + } else { + if (radio.getPacketType() == PACKET_TYPE_LORA) + radio.xfer(OPCODE_SET_LORA_SYMBOL_TIMEOUT, 1, 0, &loraTimeoutSymbols); + radio.start_rx(timeout * RC_TICKS_PER_US); + } } void Radio::Standby() @@ -310,6 +319,7 @@ radio.setPacketType(PACKET_TYPE_LORA); radio.xfer(OPCODE_SET_LORA_SYMBOL_TIMEOUT, 1, 0, &symbs); + loraTimeoutSymbols = symbs; } float Radio::GetRssiInst()