first test

Dependents:   LoRaWAN-lmic-app_tjm

Fork of LMiC by Semtech

Files at this revision

API Documentation at this revision

Comitter:
tmulrooney
Date:
Thu Feb 25 21:28:23 2016 +0000
Parent:
6:eed5fd627a2b
Commit message:
first successful join

Changed in this revision

lmic.cpp Show annotated file Show diff for this revision Revisions of this file
lmic.h Show annotated file Show diff for this revision Revisions of this file
lorabase.h Show annotated file Show diff for this revision Revisions of this file
radio.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r eed5fd627a2b -r 29058a7ccf23 lmic.cpp
--- a/lmic.cpp	Thu Feb 25 15:39:28 2016 +0000
+++ b/lmic.cpp	Thu Feb 25 21:28:23 2016 +0000
@@ -1461,8 +1461,8 @@
 {
 debug("LMIC schedRx2 enter\r\n");
     // Add 1.5 symbols we need 5 out of 8. Try to sync 1.5 symbols into the preamble.
-//    LMIC.rxtime = LMIC.txend + delay + (PAMBL_SYMS-MINRX_SYMS)*dr2hsym(LMIC.dn2Dr);
-    LMIC.rxtime = LMIC.txend + delay;
+    LMIC.rxtime = LMIC.txend + delay + (PAMBL_SYMS-MINRX_SYMS)*dr2hsym(LMIC.dn2Dr);
+//    LMIC.rxtime = LMIC.txend + delay;
     os_setTimedCallback(&LMIC.osjob, LMIC.rxtime - RX_RAMPUP, func);
 }
 
@@ -1501,8 +1501,8 @@
     else
 #endif
     {
- //       LMIC.rxtime = LMIC.txend + delay + (PAMBL_SYMS-MINRX_SYMS)*dr2hsym(LMIC.dndr);
-        LMIC.rxtime = LMIC.txend + delay;
+        LMIC.rxtime = LMIC.txend + delay + (PAMBL_SYMS-MINRX_SYMS)*dr2hsym(LMIC.dndr);
+//        LMIC.rxtime = LMIC.txend + delay;
         LMIC.rxsyms = MINRX_SYMS;
     }
     os_setTimedCallback(&LMIC.osjob, LMIC.rxtime - RX_RAMPUP, func);
diff -r eed5fd627a2b -r 29058a7ccf23 lmic.h
--- a/lmic.h	Thu Feb 25 15:39:28 2016 +0000
+++ b/lmic.h	Thu Feb 25 21:28:23 2016 +0000
@@ -19,7 +19,7 @@
 //#define CFG_eu868                                   1
 #define CFG_us915                                   1
 #define CHNL_HYBRID     0       /* US915: 0-7 to select block of 8 channels used */
-#define JOIN_REQ_DEBUG 0
+//#define JOIN_REQ_DEBUG 0
 
 #define USE_SMTC_RADIO_DRIVER                       1
 
diff -r eed5fd627a2b -r 29058a7ccf23 lorabase.h
--- a/lorabase.h	Thu Feb 25 15:39:28 2016 +0000
+++ b/lorabase.h	Thu Feb 25 21:28:23 2016 +0000
@@ -116,8 +116,7 @@
        US915_125kHz_UPFSTEP =    200000,
        US915_500kHz_UPFBASE = 903000000,
        US915_500kHz_UPFSTEP =   1600000,
-//       US915_500kHz_DNFBASE = 923300000,
-        US915_500kHz_DNFBASE = 925100000,
+       US915_500kHz_DNFBASE = 923300000,
        US915_500kHz_DNFSTEP =    600000
 };
 enum { US915_FREQ_MIN = 902000000,
diff -r eed5fd627a2b -r 29058a7ccf23 radio.cpp
--- a/radio.cpp	Thu Feb 25 15:39:28 2016 +0000
+++ b/radio.cpp	Thu Feb 25 21:28:23 2016 +0000
@@ -240,7 +240,7 @@
 
 void os_radio( u1_t mode )
 {
-debug_val("os_radio enter ",mode);
+//debug_val("os_radio enter ",mode);
     hal_disableIRQs( );
     switch( mode ) 
     {
@@ -772,7 +772,7 @@
 
 static void txfsk () 
 {
-debug("txfsk enter\r\n");
+debug_str("txfsk enter\r\n");
     // select FSK modem (from sleep mode)
     writeReg(RegOpMode, 0x10); // FSK, BT=0.5
     ASSERT(readReg(RegOpMode) == 0x10);
@@ -824,7 +824,7 @@
 
 static void txlora () 
 {
-debug("txlora enter\r\n");
+debug_str("txlora enter\r\n");
     // select LoRa modem (from sleep mode)
     //writeReg(RegOpMode, OPMODE_LORA);
     opmodeLora();
@@ -871,7 +871,7 @@
 // start transmitter (buf=LMIC.frame, len=LMIC.dataLen)
 static void starttx () 
 {
-debug("starttx enter\r\n");
+debug_str("starttx enter\r\n");
     ASSERT( (readReg(RegOpMode) & OPMODE_MASK) == OPMODE_SLEEP );
     if(getSf(LMIC.rps) == FSK) { // FSK modem
         txfsk();
@@ -893,7 +893,7 @@
 // start LoRa receiver (time=LMIC.rxtime, timeout=LMIC.rxsyms, result=LMIC.frame[LMIC.dataLen])
 static void rxlora (u1_t rxmode) 
 {
-debug("rxlora enter\r\n");
+debug_str("rxlora enter\r\n");
     // select LoRa modem (from sleep mode)
     opmodeLora();
     ASSERT((readReg(RegOpMode) & OPMODE_LORA) != 0);
@@ -951,7 +951,7 @@
 
 static void rxfsk (u1_t rxmode) 
 {
-debug("rxfsk enter\r\n");
+debug_str("rxfsk enter\r\n");
     // only single rx (no continuous scanning, no noise sampling)
     ASSERT( rxmode == RXMODE_SINGLE );
     // select FSK modem (from sleep mode)
@@ -1011,7 +1011,7 @@
 
 static void startrx (u1_t rxmode) 
 {
-debug("startrx enter\r\n");
+debug_str("startrx enter\r\n");
     ASSERT( (readReg(RegOpMode) & OPMODE_MASK) == OPMODE_SLEEP );
     if(getSf(LMIC.rps) == FSK) { // FSK modem
         rxfsk(rxmode);
@@ -1131,7 +1131,7 @@
 // (radio goes to stanby mode after tx/rx operations)
 void radio_irq_handler (u1_t dio) 
 {
-debug("radio_irq_handler enter %d\r\n",dio);
+debug_val("radio_irq_handler enter %d\r\n",dio);
     ostime_t now = os_getTime();
     if( (readReg(RegOpMode) & OPMODE_LORA) != 0) { // LORA modem
         u1_t flags = readReg(LORARegIrqFlags);
@@ -1197,8 +1197,8 @@
 
 void os_radio (u1_t mode) 
 {
-debug("os_radio enter\r\n");
-    hal_disableIRQs();
+//debug("os_radio enter\r\n");
+ //   hal_disableIRQs();
     switch (mode) {
       case RADIO_RST:
         // put radio to sleep