Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of lmic_MOTE_L152RC by
Revision 10:6c0830baf10f, committed 2015-12-04
- Comitter:
- dudmuck
- Date:
- Fri Dec 04 01:05:11 2015 +0000
- Parent:
- 9:83ae7f34e88c
- Commit message:
- correct DR4 channel used in 8ch mode. added JOIN_SINGLE_CHANNEL_BLOCK option for faster joining in 8ch mode.
Changed in this revision
| lmic.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/lmic.cpp Mon Nov 16 23:52:45 2015 +0000
+++ b/lmic.cpp Fri Dec 04 01:05:11 2015 +0000
@@ -861,7 +861,7 @@
if( LMIC.datarate >= DR_SF8C ) { // 500kHz
#ifdef CHNL_HYBRID
- LMIC.txChnl = 1 << CHNL_HYBRID; // only one channel possible
+ LMIC.txChnl = CHNL_HYBRID + 64; // only one channel possible
#else
en_cnt = count_bits(LMIC.channelMap[4]);
do {
@@ -942,7 +942,7 @@
setDrJoin(DRCHG_SET, DR_SF7);
}
-static ostime_t nextJoinState (void) {
+static ostime_t nextJoinState (void) { // us915
u1_t failed = 0;
#if 0
@@ -967,11 +967,16 @@
if( LMIC.datarate == DR_SF8C ) {
// attempted 500khz channel, try 125khz channel in next block
LMIC.datarate = DR_SF10;
+#ifdef JOIN_SINGLE_CHANNEL_BLOCK
+ if (++LMIC.joinBlockChnl == 8)
+ LMIC.joinBlockChnl = 0;
+#else
if (++LMIC.joinBlock == 8) {
LMIC.joinBlock = 0;
if (++LMIC.joinBlockChnl == 8)
LMIC.joinBlockChnl = 0;
}
+#endif /* !JOIN_SINGLE_CHANNEL_BLOCK */
LMIC.txChnl = (LMIC.joinBlock << 3) + LMIC.joinBlockChnl;
} else {
// attempted 125khz channel, try 500khz channel
@@ -1385,7 +1390,8 @@
static void schedRx2 (ostime_t delay, osjobcb_t func) {
// 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 + /* PAMBL_SYMS-MINRX_SYMS)* */ dr2hsym(LMIC.dn2Dr);
+ LMIC.rxtime -= us2osticks(4);
os_setTimedCallback(&LMIC.osjob, LMIC.rxtime - RX_RAMPUP, func);
}
@@ -1418,7 +1424,7 @@
else
#endif
{
- LMIC.rxtime = LMIC.txend + delay + (PAMBL_SYMS-MINRX_SYMS)*dr2hsym(LMIC.dndr);
+ LMIC.rxtime = LMIC.txend + delay + (PAMBL_SYMS-MINRX_SYMS) * dr2hsym(LMIC.dndr);
LMIC.rxsyms = MINRX_SYMS;
}
os_setTimedCallback(&LMIC.osjob, LMIC.rxtime - RX_RAMPUP, func);
