diff --git a/lib/arduino-lmic-1.5.0-arduino-2-tweaked/src/lmic/lmic.c b/lib/arduino-lmic-1.5.0-arduino-2-tweaked/src/lmic/lmic.c index c0c1bbc3..a6e42933 100644 --- a/lib/arduino-lmic-1.5.0-arduino-2-tweaked/src/lmic/lmic.c +++ b/lib/arduino-lmic-1.5.0-arduino-2-tweaked/src/lmic/lmic.c @@ -907,7 +907,7 @@ static ostime_t nextJoinState (void) { } else { LMIC.txChnl = os_getRndU1() & 0x3F; s1_t dr = DR_SF7 - ++LMIC.txCnt; - if( dr < DR_SF10 ) { + if( LMIC.txCnt > DR_SF7 ) { dr = DR_SF10; failed = 1; // All DR exhausted - signal failed } diff --git a/src/lorawan.cpp b/src/lorawan.cpp index 26ef93a3..7f93c1e6 100644 --- a/src/lorawan.cpp +++ b/src/lorawan.cpp @@ -45,8 +45,8 @@ void gen_lora_deveui(uint8_t *pdeveui) { *p++ = dmac[5]; *p++ = dmac[4]; *p++ = dmac[3]; - *p++ = 0xff; *p++ = 0xfe; + *p++ = 0xff; *p++ = dmac[2]; *p++ = dmac[1]; *p++ = dmac[0]; @@ -247,9 +247,7 @@ void lorawan_loop(void *pvParameters) { configASSERT(((uint32_t)pvParameters) == 1); // FreeRTOS check while (1) { - //vTaskSuspendAll(); os_runloop_once(); // execute LMIC jobs - //xTaskResumeAll(); vTaskDelay(2 / portTICK_PERIOD_MS); // yield to CPU } }