diff --git a/README.md b/README.md index 640b5f2c..6d39ecee 100644 --- a/README.md +++ b/README.md @@ -288,7 +288,6 @@ If the library is configured for US915 operation, we make the following changes: - Add the APIs `LMIC_enableChannel()`, `LMIC_enableSubBand()`, `LMIC_disableSubBand()`, and `LMIC_selectSubBand()`. -- Add the constants `MAX_XCHANNELS`. - Add a number of additional `DR_...` symbols. ### Selecting the target radio transceiver diff --git a/src/lmic/lmic.h b/src/lmic/lmic.h index 471f1f96..8fa7d760 100644 --- a/src/lmic/lmic.h +++ b/src/lmic/lmic.h @@ -172,10 +172,8 @@ struct lmic_saved_adr_state_s { #elif CFG_LMIC_US_like // US915 spectrum ================================================= -enum { MAX_XCHANNELS = 2 }; // extra channels in RAM, channels 0-71 are immutable - struct lmic_saved_adr_state_s { - u2_t channelMap[(72+MAX_XCHANNELS+15)/16]; // enabled bits + u2_t channelMap[(72+15)/16]; // enabled bits u2_t activeChannels125khz; u2_t activeChannels500khz; }; @@ -532,9 +530,7 @@ struct lmic_t { u2_t channelDrMap[MAX_CHANNELS]; u2_t channelMap; #elif CFG_LMIC_US_like - u4_t xchFreq[MAX_XCHANNELS]; // extra channel frequencies (if device is behind a repeater) - u2_t xchDrMap[MAX_XCHANNELS]; // extra channel datarate ranges ---XXX: ditto - u2_t channelMap[(72+MAX_XCHANNELS+15)/16]; // enabled bits + u2_t channelMap[(72+15)/16]; // enabled bits u2_t activeChannels125khz; u2_t activeChannels500khz; #endif diff --git a/src/lmic/lmic_us915.c b/src/lmic/lmic_us915.c index 0d84ac13..352d687e 100644 --- a/src/lmic/lmic_us915.c +++ b/src/lmic/lmic_us915.c @@ -100,20 +100,17 @@ u4_t LMICus915_convFreq(xref2cu1_t ptr) { } bit_t LMIC_setupChannel(u1_t chidx, u4_t freq, u2_t drmap, s1_t band) { + LMIC_API_PARAMETER(chidx); + LMIC_API_PARAMETER(freq); + LMIC_API_PARAMETER(drmap); LMIC_API_PARAMETER(band); - if (chidx < 72 || chidx >= 72 + MAX_XCHANNELS) - return 0; // channels 0..71 are hardwired - LMIC.xchFreq[chidx - 72] = freq; - // TODO(tmm@mcci.com): don't use US SF directly, use something from the LMIC context or a static const - LMIC.xchDrMap[chidx - 72] = drmap == 0 ? DR_RANGE_MAP(US915_DR_SF10, US915_DR_SF8C) : drmap; - LMIC.channelMap[chidx >> 4] |= (1 << (chidx & 0xF)); - return 1; + return 0; // channels 0..71 are hardwired } bit_t LMIC_disableChannel(u1_t channel) { bit_t result = 0; - if (channel < 72 + MAX_XCHANNELS) { + if (channel < 72) { if (ENABLED_CHANNEL(channel)) { result = 1; if (IS_CHANNEL_125khz(channel)) @@ -128,7 +125,7 @@ bit_t LMIC_disableChannel(u1_t channel) { bit_t LMIC_enableChannel(u1_t channel) { bit_t result = 0; - if (channel < 72 + MAX_XCHANNELS) { + if (channel < 72) { if (!ENABLED_CHANNEL(channel)) { result = 1; if (IS_CHANNEL_125khz(channel)) @@ -197,13 +194,7 @@ void LMICus915_updateTx(ostime_t txbeg) { } else { // at 500kHz bandwidth, we're allowed more power. LMIC.txpow = 26; - if (chnl < 64 + 8) { - LMIC.freq = US915_500kHz_UPFBASE + (chnl - 64)*US915_500kHz_UPFSTEP; - } - else { - ASSERT(chnl < 64 + 8 + MAX_XCHANNELS); - LMIC.freq = LMIC.xchFreq[chnl - 72]; - } + LMIC.freq = US915_500kHz_UPFBASE + (chnl - 64)*US915_500kHz_UPFSTEP; } // Update global duty cycle stats