Skip to content

Commit f35e6e3

Browse files
authored
Merge pull request #732 from mcci-catena/issue730
Fix #730: uninitialized variable
2 parents 9a3792d + 43fedd5 commit f35e6e3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/lmic/lmic_as923.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ ostime_t LMICas923_nextTx(ostime_t now) {
395395

396396
// make a mask of candidates available for use
397397
availMap = 0;
398+
feasibleMap = 0;
398399
for (u1_t chnl = 0; chnl < MAX_CHANNELS; ++chnl) {
399400
u2_t chnlBit = 1 << chnl;
400401

@@ -410,9 +411,10 @@ ostime_t LMICas923_nextTx(ostime_t now) {
410411
if ((LMIC.channelDrMap[chnl] & (1 << (LMIC.datarate & 0xF))) == 0)
411412
continue;
412413

413-
// not available yet?
414+
// This channel is feasible. But might not be available.
414415
feasibleMap |= chnlBit;
415416

417+
// not available yet?
416418
u1_t const band = LMIC.channelFreq[chnl] & 0x3;
417419
if ((s4_t)(LMIC.bands[band].avail - mintime) > 0)
418420
continue;

src/lmic/lmic_eu868.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,24 +285,26 @@ ostime_t LMICeu868_nextTx(ostime_t now) {
285285

286286
// make a mask of candidates available for use
287287
availMap = 0;
288+
feasibleMap = 0;
288289
for (u1_t chnl = 0; chnl < MAX_CHANNELS; ++chnl) {
289290
u2_t chnlBit = 1 << chnl;
290291

291292
// none at any higher numbers?
292293
if (LMIC.channelMap < chnlBit)
293294
break;
294295

295-
// not enabled?
296+
// not enabled?
296297
if ((LMIC.channelMap & chnlBit) == 0)
297298
continue;
298299

299300
// not feasible?
300301
if ((LMIC.channelDrMap[chnl] & (1 << (LMIC.datarate & 0xF))) == 0)
301302
continue;
302303

303-
// not available yet?
304+
// This channel is feasible. But might not be available.
304305
feasibleMap |= chnlBit;
305306

307+
// not available yet?
306308
u1_t const band = LMIC.channelFreq[chnl] & 0x3;
307309
if ((s4_t)(LMIC.bands[band].avail - mintime) > 0)
308310
continue;

0 commit comments

Comments
 (0)