mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-02 07:10:02 +00:00
nimble/ll: add BLE_LL_PHY config
This config infers value from PHY flags and replaces BLE_LL_BT5_PHY_SUPPORTED define.
This commit is contained in:
committed by
Krzysztof Kopyściński
parent
5680da3c6a
commit
ba1a746b8f
@@ -53,12 +53,6 @@ void ble_ll_assert(const char *file, unsigned line) __attribute((noreturn));
|
||||
#define BLE_LL_ASSERT(cond) assert(cond)
|
||||
#endif
|
||||
|
||||
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_2M_PHY) || MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_CODED_PHY)
|
||||
#define BLE_LL_BT5_PHY_SUPPORTED (1)
|
||||
#else
|
||||
#define BLE_LL_BT5_PHY_SUPPORTED (0)
|
||||
#endif
|
||||
|
||||
/* Controller revision. */
|
||||
#define BLE_LL_SUB_VERS_NR (0x0000)
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ struct ble_ll_conn_sm
|
||||
uint16_t host_req_max_rx_time;
|
||||
#endif
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
struct ble_ll_conn_phy_data phy_data;
|
||||
uint16_t phy_instant;
|
||||
uint8_t phy_tx_transition;
|
||||
|
||||
@@ -1123,7 +1123,7 @@ ble_ll_adv_tx_start_cb(struct ble_ll_sched_item *sch)
|
||||
rc = ble_phy_setchan(advsm->adv_chan, BLE_ACCESS_ADDR_ADV, BLE_LL_CRCINIT_ADV);
|
||||
BLE_LL_ASSERT(rc == 0);
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
/* Set phy mode */
|
||||
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
|
||||
if (advsm->props & BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY) {
|
||||
@@ -1269,7 +1269,7 @@ ble_ll_adv_secondary_tx_start_cb(struct ble_ll_sched_item *sch)
|
||||
BLE_LL_CRCINIT_ADV);
|
||||
BLE_LL_ASSERT(rc == 0);
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
/* Set phy mode */
|
||||
ble_phy_mode_set(advsm->sec_phy, advsm->sec_phy);
|
||||
#endif
|
||||
@@ -2264,7 +2264,7 @@ ble_ll_adv_sync_tx_start_cb(struct ble_ll_sched_item *sch)
|
||||
|
||||
BLE_LL_ASSERT(rc == 0);
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
/* Set phy mode */
|
||||
ble_phy_mode_set(advsm->sec_phy, advsm->sec_phy);
|
||||
#endif
|
||||
|
||||
@@ -554,7 +554,7 @@ ble_ll_conn_find_by_peer_addr(const uint8_t *addr, uint8_t addr_type)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
static inline int
|
||||
ble_ll_conn_phy_should_update(uint8_t pref_mask, uint8_t curr_mask)
|
||||
{
|
||||
@@ -1003,7 +1003,7 @@ ble_ll_conn_chk_csm_flags(struct ble_ll_conn_sm *connsm)
|
||||
}
|
||||
|
||||
/* Check if we need to send PHY update complete event */
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
if (connsm->flags.phy_update_host_w4event) {
|
||||
if (!ble_ll_hci_ev_phy_update(connsm, BLE_ERR_SUCCESS)) {
|
||||
/* Sent event. Clear flag */
|
||||
@@ -1040,7 +1040,7 @@ ble_ll_conn_adjust_pyld_len(struct ble_ll_conn_sm *connsm, uint16_t pyld_len)
|
||||
uint16_t max_pyld_len;
|
||||
uint16_t ret;
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
uint8_t phy_mode;
|
||||
|
||||
if (connsm->phy_tx_transition) {
|
||||
@@ -1268,7 +1268,7 @@ ble_ll_conn_tx_pdu(struct ble_ll_conn_sm *connsm)
|
||||
* now. This is not the most accurate especially if we have
|
||||
* received a frame and we are replying to it.
|
||||
*/
|
||||
#if BLE_LL_BT5_PHY_SUPPORTED
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
tx_phy_mode = connsm->phy_data.tx_phy_mode;
|
||||
#else
|
||||
tx_phy_mode = BLE_PHY_MODE_1M;
|
||||
@@ -1522,7 +1522,7 @@ ble_ll_conn_event_start_cb(struct ble_ll_sched_item *sch)
|
||||
ble_phy_resolv_list_disable();
|
||||
#endif
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
ble_phy_mode_set(connsm->phy_data.tx_phy_mode, connsm->phy_data.rx_phy_mode);
|
||||
#endif
|
||||
|
||||
@@ -1659,7 +1659,7 @@ ble_ll_conn_can_send_next_pdu(struct ble_ll_conn_sm *connsm, uint32_t begtime,
|
||||
uint32_t allowed_usecs;
|
||||
int tx_phy_mode;
|
||||
|
||||
#if BLE_LL_BT5_PHY_SUPPORTED
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
tx_phy_mode = connsm->phy_data.tx_phy_mode;
|
||||
#else
|
||||
tx_phy_mode = BLE_PHY_MODE_1M;
|
||||
@@ -1868,7 +1868,7 @@ ble_ll_conn_set_data_len(struct ble_ll_conn_sm *connsm,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
|
||||
static void
|
||||
ble_ll_conn_set_phy(struct ble_ll_conn_sm *connsm, int tx_phy, int rx_phy)
|
||||
@@ -2005,7 +2005,7 @@ ble_ll_conn_sm_new(struct ble_ll_conn_sm *connsm)
|
||||
#endif
|
||||
|
||||
/* XXX: TODO set these based on PHY that started connection */
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
connsm->phy_data.cur_tx_phy = BLE_PHY_1M;
|
||||
connsm->phy_data.cur_rx_phy = BLE_PHY_1M;
|
||||
connsm->phy_data.tx_phy_mode = BLE_PHY_MODE_1M;
|
||||
@@ -2136,7 +2136,7 @@ ble_ll_conn_update_eff_data_len(struct ble_ll_conn_sm *connsm)
|
||||
* connection events timings.
|
||||
*/
|
||||
if (ota_max_rx_time_calc) {
|
||||
#if BLE_LL_BT5_PHY_SUPPORTED
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
phy_mode = ble_ll_phy_to_phy_mode(connsm->phy_data.cur_rx_phy,
|
||||
BLE_HCI_LE_PHY_CODED_S8_PREF);
|
||||
#else
|
||||
@@ -2639,7 +2639,7 @@ ble_ll_conn_next_event(struct ble_ll_conn_sm *connsm)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
if (connsm->flags.phy_update_sched &&
|
||||
(connsm->event_cntr == connsm->phy_instant)) {
|
||||
|
||||
@@ -2846,7 +2846,7 @@ ble_ll_conn_created(struct ble_ll_conn_sm *connsm, struct ble_mbuf_hdr *rxhdr)
|
||||
|
||||
/* Send connection complete event to inform host of connection */
|
||||
if (rc) {
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1) && MYNEWT_VAL(BLE_LL_CONN_PHY_INIT_UPDATE)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY) && MYNEWT_VAL(BLE_LL_CONN_PHY_INIT_UPDATE)
|
||||
/*
|
||||
* If we have default phy preferences and they are different than
|
||||
* the current PHY's in use, start update procedure.
|
||||
@@ -3216,7 +3216,7 @@ ble_ll_conn_send_connect_req(struct os_mbuf *rxpdu,
|
||||
|
||||
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
|
||||
if (ext) {
|
||||
#if BLE_LL_BT5_PHY_SUPPORTED
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
phy = rxhdr->rxinfo.phy;
|
||||
#else
|
||||
phy = BLE_PHY_1M;
|
||||
@@ -3240,7 +3240,7 @@ ble_ll_conn_send_connect_req(struct os_mbuf *rxpdu,
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) && BLE_LL_BT5_PHY_SUPPORTED
|
||||
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) && MYNEWT_VAL(BLE_LL_PHY)
|
||||
if (ext) {
|
||||
ble_ll_conn_init_phy(connsm, phy);
|
||||
}
|
||||
@@ -3288,7 +3288,7 @@ ble_ll_conn_central_start(uint8_t phy, uint8_t csa,
|
||||
#endif
|
||||
|
||||
ble_ll_conn_set_csa(connsm, csa);
|
||||
#if BLE_LL_BT5_PHY_SUPPORTED
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
ble_ll_conn_init_phy(connsm, phy);
|
||||
#endif
|
||||
ble_ll_conn_created(connsm, NULL);
|
||||
@@ -3316,12 +3316,12 @@ ble_ll_conn_created_on_aux(struct os_mbuf *rxpdu,
|
||||
struct ble_ll_scan_addr_data *addrd,
|
||||
uint8_t *targeta)
|
||||
{
|
||||
#if BLE_LL_BT5_PHY_SUPPORTED
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
struct ble_mbuf_hdr *rxhdr;
|
||||
#endif
|
||||
uint8_t phy;
|
||||
|
||||
#if BLE_LL_BT5_PHY_SUPPORTED
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
rxhdr = BLE_MBUF_HDR_PTR(rxpdu);
|
||||
phy = rxhdr->rxinfo.phy;
|
||||
#else
|
||||
@@ -3698,7 +3698,7 @@ ble_ll_conn_rx_isr_end(uint8_t *rxbuf, struct ble_mbuf_hdr *rxhdr)
|
||||
* to the 'additional usecs' field to save some calculations.
|
||||
*/
|
||||
begtime = rxhdr->beg_cputime;
|
||||
#if BLE_LL_BT5_PHY_SUPPORTED
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
rx_phy_mode = connsm->phy_data.rx_phy_mode;
|
||||
#else
|
||||
rx_phy_mode = BLE_PHY_MODE_1M;
|
||||
@@ -3834,7 +3834,7 @@ ble_ll_conn_rx_isr_end(uint8_t *rxbuf, struct ble_mbuf_hdr *rxhdr)
|
||||
rem_bytes = OS_MBUF_PKTLEN(txpdu) - txhdr->txinfo.offset;
|
||||
/* Adjust payload for max TX time and octets */
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
if (BLE_LL_LLID_IS_CTRL(hdr_byte) &&
|
||||
CONN_IS_PERIPHERAL(connsm) &&
|
||||
(opcode == BLE_LL_CTRL_PHY_UPDATE_IND)) {
|
||||
@@ -4167,7 +4167,7 @@ ble_ll_conn_periph_start(uint8_t *rxbuf, uint8_t pat, struct ble_mbuf_hdr *rxhdr
|
||||
connsm->conn_role = BLE_LL_CONN_ROLE_PERIPHERAL;
|
||||
ble_ll_conn_sm_new(connsm);
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
/* Use the same PHY as we received CONNECT_REQ on */
|
||||
ble_ll_conn_init_phy(connsm, rxhdr->rxinfo.phy);
|
||||
#endif
|
||||
|
||||
@@ -1917,7 +1917,7 @@ ble_ll_conn_hci_wr_auth_pyld_tmo(const uint8_t *cmdbuf, uint8_t len,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
/**
|
||||
* Read current phy for connection (OGF=8, OCF==0x0030)
|
||||
*
|
||||
|
||||
@@ -184,7 +184,7 @@ ble_ll_ctrl_rej_ext_ind_make(uint8_t rej_opcode, uint8_t err, uint8_t *ctrdata)
|
||||
ctrdata[1] = err;
|
||||
}
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
/**
|
||||
* Called to cancel a phy update procedure.
|
||||
*
|
||||
@@ -546,7 +546,7 @@ ble_ll_ctrl_proc_unk_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr, uint8_t *
|
||||
ctrl_proc = BLE_LL_CTRL_PROC_LE_PING;
|
||||
BLE_LL_CONN_CLEAR_FEATURE(connsm, BLE_LL_FEAT_LE_PING);
|
||||
break;
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED ==1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
case BLE_LL_CTRL_PHY_REQ:
|
||||
ble_ll_ctrl_phy_update_cancel(connsm, BLE_ERR_UNSUPP_REM_FEATURE);
|
||||
ctrl_proc = BLE_LL_CTRL_PROC_PHY_UPDATE;
|
||||
@@ -656,7 +656,7 @@ ble_ll_ctrl_phy_from_phy_mask(uint8_t phy_mask)
|
||||
return phy;
|
||||
}
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
uint8_t
|
||||
ble_ll_ctrl_phy_tx_transition_get(uint8_t phy_mask)
|
||||
{
|
||||
@@ -1970,7 +1970,7 @@ ble_ll_ctrl_rx_reject_ind(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
|
||||
connsm->enc_data.enc_state = CONN_ENC_S_UNENCRYPTED;
|
||||
break;
|
||||
#endif
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
case BLE_LL_CTRL_PROC_PHY_UPDATE:
|
||||
ble_ll_ctrl_phy_update_cancel(connsm, ble_error);
|
||||
ble_ll_ctrl_proc_stop(connsm, BLE_LL_CTRL_PROC_PHY_UPDATE);
|
||||
@@ -2502,7 +2502,7 @@ ble_ll_ctrl_proc_init(struct ble_ll_conn_sm *connsm, int ctrl_proc, void *data)
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
case BLE_LL_CTRL_PROC_PHY_UPDATE:
|
||||
opcode = BLE_LL_CTRL_PHY_REQ;
|
||||
ble_ll_ctrl_phy_req_rsp_make(connsm, ctrdata);
|
||||
@@ -2957,7 +2957,7 @@ ble_ll_ctrl_rx_pdu(struct ble_ll_conn_sm *connsm, struct os_mbuf *om)
|
||||
/* Sometimes reject triggers sending other LL CTRL msg */
|
||||
rsp_opcode = ble_ll_ctrl_rx_reject_ind(connsm, dptr, opcode, rspdata);
|
||||
break;
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
case BLE_LL_CTRL_PHY_REQ:
|
||||
rsp_opcode = ble_ll_ctrl_rx_phy_req(connsm, dptr, rspdata);
|
||||
break;
|
||||
@@ -3177,7 +3177,7 @@ ble_ll_ctrl_tx_done(struct os_mbuf *txpdu, struct ble_ll_conn_sm *connsm)
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
#if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
|
||||
case BLE_LL_CTRL_PHY_REQ:
|
||||
if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
|
||||
|
||||
@@ -365,7 +365,7 @@ ble_ll_hci_le_read_bufsize_v2(uint8_t *rspbuf, uint8_t *rsplen)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
/**
|
||||
* Checks the preferred phy masks for validity and places the preferred masks
|
||||
* in the input phy masks
|
||||
@@ -1110,7 +1110,7 @@ ble_ll_hci_le_cmd_proc(const uint8_t *cmdbuf, uint8_t len, uint16_t ocf,
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
#if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL) || MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
|
||||
case BLE_HCI_OCF_LE_RD_PHY:
|
||||
rc = ble_ll_conn_hci_le_rd_phy(cmdbuf, len, rspbuf, rsplen);
|
||||
|
||||
@@ -432,7 +432,7 @@ ble_ll_hci_ev_send_adv_set_terminated(uint8_t status, uint8_t adv_handle,
|
||||
* @param connsm Pointer to connection state machine
|
||||
* @param status error status of event
|
||||
*/
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
int
|
||||
ble_ll_hci_ev_phy_update(struct ble_ll_conn_sm *connsm, uint8_t status)
|
||||
{
|
||||
|
||||
@@ -161,7 +161,7 @@ static const uint8_t octet_35 = OCTET(
|
||||
BIT(2) /* HCI LE Set Resolvable Private Address Timeout */
|
||||
#endif
|
||||
BIT(3) /* HCI LE Read Maximum Data Length */
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
#if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL) || MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
|
||||
BIT(4) /* HCI LE Read PHY */
|
||||
BIT(5) /* HCI LE Set Default PHY */
|
||||
|
||||
@@ -741,7 +741,7 @@ ble_ll_iso_big_event_sched_cb(struct ble_ll_sched_item *sch)
|
||||
{
|
||||
struct ble_ll_iso_big *big;
|
||||
struct ble_ll_iso_bis *bis;
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
uint8_t phy_mode;
|
||||
#endif
|
||||
int rc;
|
||||
@@ -755,7 +755,7 @@ ble_ll_iso_big_event_sched_cb(struct ble_ll_sched_item *sch)
|
||||
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY)
|
||||
ble_phy_resolv_list_disable();
|
||||
#endif
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
phy_mode = ble_ll_phy_to_phy_mode(big->phy, 0);
|
||||
ble_phy_mode_set(phy_mode, phy_mode);
|
||||
#endif
|
||||
|
||||
@@ -749,7 +749,7 @@ ble_ll_scan_start(struct ble_ll_scan_sm *scansm)
|
||||
int rc;
|
||||
struct ble_ll_scan_phy *scanp = scansm->scanp;
|
||||
uint8_t chan;
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
uint8_t phy_mode;
|
||||
int phy;
|
||||
#endif
|
||||
@@ -779,7 +779,7 @@ ble_ll_scan_start(struct ble_ll_scan_sm *scansm)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
phy = scanp->phy;
|
||||
phy_mode = ble_ll_phy_to_phy_mode(phy, BLE_HCI_LE_PHY_CODED_ANY);
|
||||
ble_phy_mode_set(phy_mode, phy_mode);
|
||||
|
||||
@@ -111,7 +111,7 @@ static int
|
||||
ble_ll_scan_aux_sched_cb(struct ble_ll_sched_item *sch)
|
||||
{
|
||||
struct ble_ll_scan_aux_data *aux = sch->cb_arg;
|
||||
#if BLE_LL_BT5_PHY_SUPPORTED
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
uint8_t phy_mode;
|
||||
#endif
|
||||
uint8_t lls;
|
||||
@@ -137,7 +137,7 @@ ble_ll_scan_aux_sched_cb(struct ble_ll_sched_item *sch)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if BLE_LL_BT5_PHY_SUPPORTED
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
phy_mode = ble_ll_phy_to_phy_mode(aux->sec_phy, BLE_HCI_LE_PHY_CODED_ANY);
|
||||
ble_phy_mode_set(phy_mode, phy_mode);
|
||||
#endif
|
||||
|
||||
@@ -228,7 +228,7 @@ ble_ll_sync_sm_clear(struct ble_ll_sync_sm *sm)
|
||||
static uint8_t
|
||||
ble_ll_sync_phy_mode_to_hci(int8_t phy_mode)
|
||||
{
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
switch (phy_mode) {
|
||||
case BLE_PHY_MODE_1M:
|
||||
return BLE_HCI_LE_PHY_1M;
|
||||
@@ -475,7 +475,7 @@ ble_ll_sync_event_start_cb(struct ble_ll_sched_item *sch)
|
||||
ble_phy_encrypt_disable();
|
||||
#endif
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
ble_phy_mode_set(sm->phy_mode, sm->phy_mode);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -564,6 +564,9 @@ syscfg.defs:
|
||||
This is the stack size for LL task.
|
||||
value: 120
|
||||
|
||||
syscfg.defs.'BLE_LL_CFG_FEAT_LE_2M_PHY || BLE_LL_CFG_FEAT_LE_CODED_PHY':
|
||||
BLE_LL_PHY: 1
|
||||
|
||||
syscfg.vals.BLE_LL_CFG_FEAT_LL_EXT_ADV:
|
||||
BLE_LL_CFG_FEAT_LE_CSA2: 1
|
||||
BLE_HW_WHITELIST_ENABLE: 0
|
||||
|
||||
@@ -639,7 +639,7 @@ ble_phy_irq_frame_tx_exc_bs_stop(void)
|
||||
(void)CMAC->CM_TS1_REG;
|
||||
|
||||
if (g_ble_phy_data.end_transition == BLE_PHY_TRANSITION_TX_RX) {
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
ble_phy_mode_apply(g_ble_phy_data.phy_mode_rx);
|
||||
#endif
|
||||
ble_phy_rx_setup_fields();
|
||||
@@ -895,7 +895,7 @@ ble_phy_irq_frame_rx_exc_phy_to_idle_4this(void)
|
||||
CMAC->CM_EXC_STAT_REG = CMAC_CM_EXC_STAT_REG_EXC_PHY_TO_IDLE_4THIS_Msk;
|
||||
|
||||
/* We are here only on transition, so switch to TX */
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
ble_phy_mode_apply(g_ble_phy_data.phy_mode_tx);
|
||||
#endif
|
||||
rf_chan = g_ble_phy_chan_to_rf[g_ble_phy_data.channel];
|
||||
@@ -1016,7 +1016,7 @@ ble_phy_mode_set(uint8_t tx_phy_mode, uint8_t rx_phy_mode)
|
||||
static int
|
||||
ble_phy_get_cur_phy(void)
|
||||
{
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
switch (g_ble_phy_data.phy_mode_cur) {
|
||||
case BLE_PHY_MODE_1M:
|
||||
return BLE_PHY_1M;
|
||||
@@ -1357,7 +1357,7 @@ ble_phy_rx_set_start_time(uint32_t cputime, uint8_t rem_usecs)
|
||||
|
||||
MCU_DIAG_SER('r');
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
ble_phy_mode_apply(g_ble_phy_data.phy_mode_rx);
|
||||
#endif
|
||||
|
||||
@@ -1485,7 +1485,7 @@ ble_phy_tx_set_start_time(uint32_t cputime, uint8_t rem_usecs)
|
||||
|
||||
MCU_DIAG_SER('t');
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
ble_phy_mode_apply(g_ble_phy_data.phy_mode_tx);
|
||||
#endif
|
||||
|
||||
@@ -1712,7 +1712,7 @@ ble_phy_restart_rx(void)
|
||||
ble_phy_disable();
|
||||
|
||||
/* Apply mode before starting RX */
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
ble_phy_mode_apply(g_ble_phy_data.phy_mode_rx);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ static const uint8_t g_ble_phy_chan_freq[BLE_PHY_NUM_CHANS] = {
|
||||
66, 68, 70, 72, 74, 76, 78, 2, 26, 80, /* 30-39 */
|
||||
};
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
/* packet start offsets (in usecs) */
|
||||
static const uint16_t g_ble_phy_mode_pkt_start_off[BLE_PHY_NUM_MODE] = {
|
||||
[BLE_PHY_MODE_1M] = 40,
|
||||
@@ -338,7 +338,7 @@ struct nrf_ccm_data
|
||||
struct nrf_ccm_data g_nrf_ccm_data;
|
||||
#endif
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
|
||||
/* Packet start offset (in usecs). This is the preamble plus access address.
|
||||
* For LE Coded PHY this also includes CI and TERM1. */
|
||||
@@ -451,7 +451,7 @@ ble_phy_mode_pdu_start_off(int phy_mode)
|
||||
static int
|
||||
ble_phy_get_cur_phy(void)
|
||||
{
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
switch (g_ble_phy_data.phy_cur_phy_mode) {
|
||||
case BLE_PHY_MODE_1M:
|
||||
return BLE_PHY_1M;
|
||||
@@ -904,7 +904,7 @@ ble_phy_wfr_enable(int txrx, uint8_t tx_phy_mode, uint32_t wfr_usecs)
|
||||
static uint32_t
|
||||
ble_phy_get_ccm_datarate(void)
|
||||
{
|
||||
#if BLE_LL_BT5_PHY_SUPPORTED
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
switch (g_ble_phy_data.phy_cur_phy_mode) {
|
||||
case BLE_PHY_MODE_1M:
|
||||
return CCM_MODE_DATARATE_1Mbit << CCM_MODE_DATARATE_Pos;
|
||||
@@ -981,7 +981,7 @@ ble_phy_rx_xcvr_setup(void)
|
||||
g_ble_phy_data.phy_rx_started = 0;
|
||||
g_ble_phy_data.phy_state = BLE_PHY_STATE_RX;
|
||||
|
||||
#if BLE_LL_BT5_PHY_SUPPORTED
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
/*
|
||||
* On Coded PHY there are CI and TERM1 fields before PDU starts so we need
|
||||
* to take this into account when setting up BCC.
|
||||
@@ -1067,7 +1067,7 @@ ble_phy_tx_end_isr(void)
|
||||
}
|
||||
|
||||
if (transition == BLE_PHY_TRANSITION_TX_RX) {
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
ble_phy_mode_apply(g_ble_phy_data.phy_rx_phy_mode);
|
||||
#endif
|
||||
|
||||
@@ -1244,7 +1244,7 @@ ble_phy_rx_end_isr(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
ble_phy_mode_apply(g_ble_phy_data.phy_tx_phy_mode);
|
||||
#endif
|
||||
|
||||
@@ -1812,7 +1812,7 @@ ble_phy_tx_set_start_time(uint32_t cputime, uint8_t rem_usecs)
|
||||
|
||||
ble_phy_trace_u32x2(BLE_PHY_TRACE_ID_START_TX, cputime, rem_usecs);
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
ble_phy_mode_apply(g_ble_phy_data.phy_tx_phy_mode);
|
||||
#endif
|
||||
|
||||
@@ -1854,7 +1854,7 @@ ble_phy_rx_set_start_time(uint32_t cputime, uint8_t rem_usecs)
|
||||
|
||||
ble_phy_trace_u32x2(BLE_PHY_TRACE_ID_START_RX, cputime, rem_usecs);
|
||||
|
||||
#if (BLE_LL_BT5_PHY_SUPPORTED == 1)
|
||||
#if MYNEWT_VAL(BLE_LL_PHY)
|
||||
ble_phy_mode_apply(g_ble_phy_data.phy_rx_phy_mode);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user