mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-12 20:20:00 +00:00
Merge pull request #569 from andrzej-kaczmarek/nimble-phy-fix
nimble/phy: Various fixes X-Original-Commit: c5a8a91549186ea0f12d75647371a3944301a29b
This commit is contained in:
@@ -200,6 +200,21 @@ ble_phy_mode_pdu_start_off(int phy_mode)
|
|||||||
void
|
void
|
||||||
ble_phy_mode_set(int cur_phy_mode, int txtorx_phy_mode)
|
ble_phy_mode_set(int cur_phy_mode, int txtorx_phy_mode)
|
||||||
{
|
{
|
||||||
|
#if MYNEWT_VAL(BSP_NRF52840)
|
||||||
|
/*
|
||||||
|
* nRF52840 Engineering A Errata v1.2
|
||||||
|
* [164] RADIO: Low sensitivity in long range mode
|
||||||
|
*/
|
||||||
|
if ((cur_phy_mode == BLE_PHY_MODE_CODED_125KBPS) ||
|
||||||
|
(cur_phy_mode == BLE_PHY_MODE_CODED_500KBPS)) {
|
||||||
|
*(volatile uint32_t *)0x4000173C |= 0x80000000;
|
||||||
|
*(volatile uint32_t *)0x4000173C = ((*(volatile uint32_t *)0x4000173C &
|
||||||
|
0xFFFFFF00) | 0x5C);
|
||||||
|
} else {
|
||||||
|
*(volatile uint32_t *)0x4000173C &= ~0x80000000;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (cur_phy_mode == BLE_PHY_MODE_1M) {
|
if (cur_phy_mode == BLE_PHY_MODE_1M) {
|
||||||
NRF_RADIO->MODE = RADIO_MODE_MODE_Ble_1Mbit;
|
NRF_RADIO->MODE = RADIO_MODE_MODE_Ble_1Mbit;
|
||||||
NRF_RADIO->PCNF0 = g_ble_phy_data.phy_pcnf0 |
|
NRF_RADIO->PCNF0 = g_ble_phy_data.phy_pcnf0 |
|
||||||
@@ -615,7 +630,6 @@ ble_phy_tx_end_isr(void)
|
|||||||
#endif
|
#endif
|
||||||
uint8_t was_encrypted;
|
uint8_t was_encrypted;
|
||||||
uint8_t transition;
|
uint8_t transition;
|
||||||
uint8_t txlen;
|
|
||||||
uint32_t wfr_time;
|
uint32_t wfr_time;
|
||||||
|
|
||||||
/* If this transmission was encrypted we need to remember it */
|
/* If this transmission was encrypted we need to remember it */
|
||||||
@@ -627,6 +641,7 @@ ble_phy_tx_end_isr(void)
|
|||||||
/* Log the event */
|
/* Log the event */
|
||||||
ble_ll_log(BLE_LL_LOG_ID_PHY_TXEND, g_ble_phy_data.phy_tx_pyld_len,
|
ble_ll_log(BLE_LL_LOG_ID_PHY_TXEND, g_ble_phy_data.phy_tx_pyld_len,
|
||||||
was_encrypted, NRF_TIMER0->CC[2]);
|
was_encrypted, NRF_TIMER0->CC[2]);
|
||||||
|
(void)was_encrypted;
|
||||||
|
|
||||||
/* Clear events and clear interrupt on disabled event */
|
/* Clear events and clear interrupt on disabled event */
|
||||||
NRF_RADIO->EVENTS_DISABLED = 0;
|
NRF_RADIO->EVENTS_DISABLED = 0;
|
||||||
@@ -667,14 +682,6 @@ ble_phy_tx_end_isr(void)
|
|||||||
/* Packet pointer needs to be reset. */
|
/* Packet pointer needs to be reset. */
|
||||||
ble_phy_rx_xcvr_setup();
|
ble_phy_rx_xcvr_setup();
|
||||||
|
|
||||||
/*
|
|
||||||
* Enable the wait for response timer. Note that cc #1 on
|
|
||||||
* timer 0 contains the transmit start time
|
|
||||||
*/
|
|
||||||
txlen = g_ble_phy_data.phy_tx_pyld_len;
|
|
||||||
if (txlen && was_encrypted) {
|
|
||||||
txlen += BLE_LL_DATA_MIC_LEN;
|
|
||||||
}
|
|
||||||
ble_phy_wfr_enable(BLE_PHY_WFR_ENABLE_TXRX, 0);
|
ble_phy_wfr_enable(BLE_PHY_WFR_ENABLE_TXRX, 0);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user