Helmut Tschemernjak / SX1276GenericLib

Dependents:   DISCO-L072CZ-LRWAN1_LoRa_PingPong DISCO-L072CZ-LRWAN1_LoRa_PingPong DISCO-L072CZ-LRWAN1_LoRa_PingPong DISCO-L072CZ-LRWAN1_LoRa_USB_Rx ... more

Fork of SX1276Lib by Semtech

Files at this revision

API Documentation at this revision

Comitter:
Helmut Tschemernjak
Date:
Sat Aug 05 16:08:26 2017 +0200
Parent:
80:62f0b027efff
Child:
82:b93c4169ce41
Commit message:
Use correct usec timestamps
More complete support for RxSignalPending detection

Changed in this revision

Arduino-mbed-APIs/arduino-util.cpp Show annotated file Show diff for this revision Revisions of this file
sx1276/sx1276.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Arduino-mbed-APIs/arduino-util.cpp	Thu Aug 03 13:43:35 2017 +0200
+++ b/Arduino-mbed-APIs/arduino-util.cpp	Sat Aug 05 16:08:26 2017 +0200
@@ -23,9 +23,7 @@
     int s = secs % 60;
     int m = secs / 60;
     int h = secs / 3600;
-    int us = us_getTicker();
-    while(us > 999999)
-        us /= 10;	// get it to 6 digits only
+    int us = us_getTicker() % 1000000;
 
     snprintf(tmpbuf, sizeof(tmpbuf)-1, "%02d:%02d:%02d.%.06d ", h, m, s, us);
     ser->write(tmpbuf, (int) sizeof "00:00:34.3436868 " -1);
--- a/sx1276/sx1276.cpp	Thu Aug 03 13:43:35 2017 +0200
+++ b/sx1276/sx1276.cpp	Sat Aug 05 16:08:26 2017 +0200
@@ -949,8 +949,8 @@
         case MODEM_FSK:
             break;
         case MODEM_LORA:
-            if (Read(REG_LR_MODEMSTAT) & RFLR_MODEMSTAT_SIGNAL_DETECTED)
-                return true;
+			if (Read(REG_LR_MODEMSTAT) & (RFLR_MODEMSTAT_SIGNAL_DETECTED|RFLR_MODEMSTAT_SIGNAL_SYNCRONIZED|RFLR_MODEMSTAT_HEADERINFO_VALID|RFLR_MODEMSTAT_MODEM_CLEAR))
+	            return true;
             break;
     }
     return false;