Skip to content

Commit

Permalink
When enabling/disabling subbands, also enable/disable the associated …
Browse files Browse the repository at this point in the history
…500 kHz channel
  • Loading branch information
terrillmoore committed Sep 11, 2016
1 parent 7cc491b commit 79be46f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lmic/lmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,16 +772,28 @@ void LMIC_enableSubBand (u1_t band) {
ASSERT(band <= 8);
u1_t start = (band-1) * 8;
u1_t end = start + 8;

// enable all eight 125 kHz channels in this subband
for (int channel=start; channel < end; ++channel )
LMIC_enableChannel(channel);

// there's a single 500 kHz channel associated with
// each group of 8 125 kHz channels. Enable it, too.
LMIC_enableChannel(64 + (band - 1));
}
void LMIC_disableSubBand (u1_t band) {
ASSERT(band > 0);
ASSERT(band <= 8);
u1_t start = (band-1) * 8;
u1_t end = start + 8;

// disable all eight 125 kHz channels in this subband
for (int channel=start; channel < end; ++channel )
LMIC_disableChannel(channel);

// there's a single 500 kHz channel associated with
// each group of 8 125 kHz channels. Disable it, too.
LMIC_disableChannel(64 + (band - 1));
}
void LMIC_selectSubBand (u1_t band) {
ASSERT(band > 0);
Expand Down

0 comments on commit 79be46f

Please sign in to comment.