From 845def579f2ccd79362674af8df2ccaaa167ea40 Mon Sep 17 00:00:00 2001 From: Terry Moore Date: Sun, 5 Aug 2018 03:25:50 -0400 Subject: [PATCH] Fix #91: && was incorrectly used instead of & --- src/lmic/lmic_us_like.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lmic/lmic_us_like.c b/src/lmic/lmic_us_like.c index b31dcdb9..7fd9c495 100644 --- a/src/lmic/lmic_us_like.c +++ b/src/lmic/lmic_us_like.c @@ -89,6 +89,8 @@ u1_t LMICuslike_mapChannels(u1_t chpage, u2_t chmap) { /* || MCMD_LADR_CHP_125ON and MCMD_LADR_CHP_125OFF are special. The || channel map appllies to 500kHz (ch 64..71) and in addition + || all channels 0..63 are turned off or on. MCMC_LADR_CHP_BANK + || is also special, in that it enables subbands. */ u1_t base, top; @@ -97,7 +99,8 @@ u1_t LMICuslike_mapChannels(u1_t chpage, u2_t chmap) { base = chpage << 4; top = base + 16; if (base == 64) { - if (chmap && 0xFF00) { + if (chmap & 0xFF00) { + // those are reserved bits, fail. return 0; } top = 72;