1

Revision:
13:a354f82d12d9
Parent:
10:3303cf2867d4
Child:
15:e1c04ec39aa4
--- a/radio_sx127x.cpp	Wed May 29 09:55:12 2019 -0700
+++ b/radio_sx127x.cpp	Fri May 31 10:21:30 2019 -0700
@@ -114,14 +114,15 @@
     radio.write_reg(REG_FSK_PACKETCONFIG1, fsk.RegPktConfig1.octet);
 }
 
-void Radio::SetLoRaSymbolTimeout(uint8_t symbs)
+void Radio::SetLoRaSymbolTimeout(uint16_t symbs)
 {
     if (!radio.RegOpMode.bits.LongRangeMode)
         lora.enable();
 
-    lora.RegModemConfig2.sx1272bits.SymbTimeoutMsb = 0;
+    radio.write_reg(REG_LR_SYMBTIMEOUTLSB, symbs & 0xff);
+    symbs >>= 8;
+    lora.RegModemConfig2.sx1272bits.SymbTimeoutMsb = symbs;
     radio.write_reg(REG_LR_MODEMCONFIG2, lora.RegModemConfig2.octet);
-    radio.write_reg(REG_LR_SYMBTIMEOUTLSB, symbs);
 }
 
 void Radio::LoRaModemConfig(unsigned bwKHz, uint8_t sf, uint8_t coderate)
@@ -231,8 +232,10 @@
     pinEvent.dio1 = 1;
 }
 
-void Radio::Init(const RadioEvents_t* e)
+void Radio::Init(const RadioEvents_t* e, unsigned spi_hz)
 {
+    radio.m_spi.frequency(spi_hz);
+
     while (radio.dio0.read() || radio.dio1.read()) {
         radio.write_reg(REG_LR_IRQFLAGS, 0xff); // clear stagnant interrupt
     }