mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-13 04:30:03 +00:00
nimble/controller: Adjust slave anchor point based on PHY used
Anchor point depends on PHY used and should be adjusted accordingly. X-Original-Commit: 7915aef02c5cd496a37401a52e53902c9ba79d70
This commit is contained in:
@@ -2291,9 +2291,24 @@ ble_ll_conn_created(struct ble_ll_conn_sm *connsm, struct ble_mbuf_hdr *rxhdr)
|
|||||||
connsm->last_anchor_point = rxhdr->beg_cputime;
|
connsm->last_anchor_point = rxhdr->beg_cputime;
|
||||||
|
|
||||||
usecs = rxhdr->rem_usecs + 1250 +
|
usecs = rxhdr->rem_usecs + 1250 +
|
||||||
(connsm->tx_win_off * BLE_LL_CONN_TX_WIN_USECS) +
|
(connsm->tx_win_off * BLE_LL_CONN_TX_WIN_USECS) +
|
||||||
ble_ll_pdu_tx_time_get(BLE_CONNECT_REQ_LEN,
|
ble_ll_pdu_tx_time_get(BLE_CONNECT_REQ_LEN,
|
||||||
connsm->phy_data.tx_phy_mode);
|
connsm->phy_data.rx_phy_mode);
|
||||||
|
|
||||||
|
if (rxhdr->rxinfo.channel < BLE_PHY_NUM_DATA_CHANS) {
|
||||||
|
switch (rxhdr->rxinfo.phy) {
|
||||||
|
case BLE_PHY_1M:
|
||||||
|
usecs += 1250;
|
||||||
|
break;
|
||||||
|
case BLE_PHY_CODED:
|
||||||
|
usecs += 2500;
|
||||||
|
break;
|
||||||
|
case BLE_PHY_2M:
|
||||||
|
default:
|
||||||
|
assert(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Anchor point is cputime. */
|
/* Anchor point is cputime. */
|
||||||
endtime = os_cputime_usecs_to_ticks(usecs);
|
endtime = os_cputime_usecs_to_ticks(usecs);
|
||||||
|
|||||||
Reference in New Issue
Block a user