mirror of https://github.com/ARMmbed/mbed-os.git
fix first element of array selection
parent
fd880d1e6b
commit
565f1e0131
|
@ -190,9 +190,13 @@ private:
|
|||
} else if (_enabledPhy[ble::phy_t::LE_2M]) {
|
||||
return 1;
|
||||
} else if (_enabledPhy[ble::phy_t::LE_CODED]) {
|
||||
if (isSwapped()) {
|
||||
return 1;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Handle toggling PHYs on and off and return the correct index to use to set the configuration elements.
|
||||
*
|
||||
|
@ -206,17 +210,13 @@ private:
|
|||
bool was_swapped = false;
|
||||
bool is_swapped = false;
|
||||
|
||||
if (_enabledPhy[ble::phy_t::LE_1M] &&
|
||||
!_enabledPhy[ble::phy_t::LE_2M] &&
|
||||
_enabledPhy[ble::phy_t::LE_CODED]) {
|
||||
if (isSwapped()) {
|
||||
was_swapped = true;
|
||||
}
|
||||
|
||||
_enabledPhy[phy.value()] = enable;
|
||||
|
||||
if (_enabledPhy[ble::phy_t::LE_1M] &&
|
||||
!_enabledPhy[ble::phy_t::LE_2M] &&
|
||||
_enabledPhy[ble::phy_t::LE_CODED]) {
|
||||
if (isSwapped()) {
|
||||
is_swapped = true;
|
||||
}
|
||||
|
||||
|
@ -231,6 +231,12 @@ private:
|
|||
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. */
|
||||
void swapCodedAnd2M() {
|
||||
uint16_t scanInterval = _scanInterval[ble::phy_t::LE_2M];
|
||||
|
|
Loading…
Reference in New Issue