mirror of https://github.com/ARMmbed/mbed-os.git
fix first element of array selection
parent
fd880d1e6b
commit
565f1e0131
|
@ -190,7 +190,11 @@ private:
|
||||||
} else if (_enabledPhy[ble::phy_t::LE_2M]) {
|
} else if (_enabledPhy[ble::phy_t::LE_2M]) {
|
||||||
return 1;
|
return 1;
|
||||||
} else if (_enabledPhy[ble::phy_t::LE_CODED]) {
|
} else if (_enabledPhy[ble::phy_t::LE_CODED]) {
|
||||||
return 2;
|
if (isSwapped()) {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,17 +210,13 @@ private:
|
||||||
bool was_swapped = false;
|
bool was_swapped = false;
|
||||||
bool is_swapped = false;
|
bool is_swapped = false;
|
||||||
|
|
||||||
if (_enabledPhy[ble::phy_t::LE_1M] &&
|
if (isSwapped()) {
|
||||||
!_enabledPhy[ble::phy_t::LE_2M] &&
|
|
||||||
_enabledPhy[ble::phy_t::LE_CODED]) {
|
|
||||||
was_swapped = true;
|
was_swapped = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
_enabledPhy[phy.value()] = enable;
|
_enabledPhy[phy.value()] = enable;
|
||||||
|
|
||||||
if (_enabledPhy[ble::phy_t::LE_1M] &&
|
if (isSwapped()) {
|
||||||
!_enabledPhy[ble::phy_t::LE_2M] &&
|
|
||||||
_enabledPhy[ble::phy_t::LE_CODED]) {
|
|
||||||
is_swapped = true;
|
is_swapped = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,6 +231,12 @@ private:
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isSwapped() const {
|
||||||
|
return (_enabledPhy[ble::phy_t::LE_1M] &&
|
||||||
|
!_enabledPhy[ble::phy_t::LE_2M] &&
|
||||||
|
_enabledPhy[ble::phy_t::LE_CODED]);
|
||||||
|
}
|
||||||
|
|
||||||
/** Handle the swapping of 2M and CODED so that the array is ready for the pal call. */
|
/** Handle the swapping of 2M and CODED so that the array is ready for the pal call. */
|
||||||
void swapCodedAnd2M() {
|
void swapCodedAnd2M() {
|
||||||
uint16_t scanInterval = _scanInterval[ble::phy_t::LE_2M];
|
uint16_t scanInterval = _scanInterval[ble::phy_t::LE_2M];
|
||||||
|
|
Loading…
Reference in New Issue