simplify and explain swapping

pull/8738/head
paul-szczepanek-arm 2018-11-26 11:26:13 +00:00
parent e0e186c831
commit a03aaa2342
1 changed files with 5 additions and 11 deletions

View File

@ -382,25 +382,19 @@ private:
{ {
uint8_t index = phyToIndex(phy); uint8_t index = phyToIndex(phy);
bool was_swapped = false; bool was_swapped = isSwapped();
bool is_swapped = false;
if (isSwapped()) {
was_swapped = true;
}
_enabledPhy[index] = enable; _enabledPhy[index] = enable;
if (isSwapped()) { bool is_swapped = isSwapped();
is_swapped = true;
}
if (was_swapped != is_swapped) { if (was_swapped != is_swapped) {
swapCodedAnd2M(); swapCodedAnd2M();
} }
if (is_swapped && phy == phy_t::LE_CODED) { if (is_swapped && index == LE_CODED_INDEX) {
index -= 1; /* to keep the data contiguous coded params are in place of the missing 2M params */
index = LE_2M_INDEX;
} }
return index; return index;