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
Diff: lmic.cpp
- Revision:
- 5:e4ba433f0ac1
- Parent:
- 0:f2716e543d97
- Child:
- 7:9095e54e381f
--- a/lmic.cpp Tue Jul 07 18:25:05 2015 +0000
+++ b/lmic.cpp Fri Jul 17 21:09:16 2015 +0000
@@ -728,10 +728,22 @@
//
-static void initDefaultChannels (void) {
+static void initDefaultChannels (void)
+{
+#ifdef CHNL_HYBRID
+ LMIC.channelMap[0] = 0xFF;
+ LMIC.channelMap[1] = 0x0;
+ LMIC.channelMap[2] = 0x0;
+ LMIC.channelMap[3] = 0x0;
+ LMIC.channelMap[4] = 0x01;
+ LMIC.txpow_limit = 20;
+#else
for( u1_t i=0; i<4; i++ )
LMIC.channelMap[i] = 0xFFFF;
LMIC.channelMap[4] = 0x00FF;
+
+ LMIC.txpow_limit = 30;
+#endif
}
static u4_t convFreq (xref2u1_t ptr) {
@@ -774,10 +786,15 @@
u1_t chnl = LMIC.txChnl;
if( chnl < 64 ) {
LMIC.freq = US915_125kHz_UPFBASE + chnl*US915_125kHz_UPFSTEP;
- LMIC.txpow = 30;
+ LMIC.txpow = LMIC.txpow_limit;
return;
}
- LMIC.txpow = 26;
+
+ if (LMIC.txpow_limit >= 26)
+ LMIC.txpow = 26;
+ else
+ LMIC.txpow = LMIC.txpow_limit;
+
if( chnl < 64+8 ) {
LMIC.freq = US915_500kHz_UPFBASE + (chnl-64)*US915_500kHz_UPFSTEP;
} else {
