Skip to content

Commit

Permalink
Update radio.c: simplify!
Browse files Browse the repository at this point in the history
  • Loading branch information
prokrypt authored Jul 24, 2024
1 parent 83e42ff commit 32ee40b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,11 @@ bool RADIO_CheckValidChannel(uint16_t channel, bool checkScanList, uint8_t scanL
//if (scanList ? !att.scanlist2 : !att.scanlist1)
// return false;

if(scanList<3){
if(!((att.scanlists >> scanList) & 1))
return false;
}
else if(scanList==3 && att.scanlists)
return false;
else if(scanList==4 && !att.scanlists)
if ((scanList < 3 && !((att.scanlists >> (2 - scanList)) & 1)) ||
(scanList == 3 && att.scanlists != 0) ||
(scanList == 4 && att.scanlists == 0)) {
return false;

}

/*
if(scanList == 0 && att.scanlist1 != 1) // scanlist 1
Expand Down

0 comments on commit 32ee40b

Please sign in to comment.