Ilya Krylov / sx12xx_hal123

Files at this revision

API Documentation at this revision

Comitter:
Wayne Roberts
Date:
Thu Dec 06 17:57:21 2018 -0800
Parent:
7:ba81f66e56d1
Child:
9:97a6de3dbc86
Commit message:
sx127x clear old interrupt on startup

Changed in this revision

radio_sx127x.cpp Show annotated file Show diff for this revision Revisions of this file
radio_sx128x.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/radio_sx127x.cpp	Wed Dec 05 15:04:48 2018 -0800
+++ b/radio_sx127x.cpp	Thu Dec 06 17:57:21 2018 -0800
@@ -233,6 +233,9 @@
 
 void Radio::Init(const RadioEvents_t* e)
 {
+    while (radio.dio0.read() || radio.dio1.read()) {
+        radio.write_reg(REG_LR_IRQFLAGS, 0xff); // clear stagnant interrupt
+    }
     dio0.rise(dio0isr);
     dio1.rise(dio1isr);
 
--- a/radio_sx128x.cpp	Wed Dec 05 15:04:48 2018 -0800
+++ b/radio_sx128x.cpp	Thu Dec 06 17:57:21 2018 -0800
@@ -381,7 +381,7 @@
 
 void Radio::SetPublicNetwork(bool en)
 {
-    uint16_t ppg;
+/*    uint16_t ppg;
 
     if (en)
         ppg = 0x3444;
@@ -389,6 +389,7 @@
         ppg = 0x1424;
 
     radio.writeReg(REG_ADDR_LORA_SYNC, ppg, 2);
+*/
 }
 
 uint32_t Radio::lora_toa_us( uint8_t pktLen )