You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2022/08/11 12:46:42 UTC

[mynewt-nimble] 02/03: nimble/phy/nrf: Force PA/LNA disable on phy disable

This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit 479eaa83edbfb8d86822c0ec9aeab58d6e622e84
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Thu Aug 11 13:15:21 2022 +0200

    nimble/phy/nrf: Force PA/LNA disable on phy disable
    
    This is to make sure PA/LNA control pins are always disabled on phy
    disable.
---
 nimble/drivers/nrf5340/src/ble_phy.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/nimble/drivers/nrf5340/src/ble_phy.c b/nimble/drivers/nrf5340/src/ble_phy.c
index 49f04a85..ac90c4f1 100644
--- a/nimble/drivers/nrf5340/src/ble_phy.c
+++ b/nimble/drivers/nrf5340/src/ble_phy.c
@@ -392,6 +392,21 @@ ble_phy_plna_disable_lna(void)
 #endif
 }
 
+static void
+ble_phy_plna_force_disable(void)
+{
+#if PLNA_SINGLE_GPIO
+    NRF_GPIOTE_NS->TASKS_CLR[plna_idx] = 1;
+#else
+#if MYNEWT_VAL(BLE_LL_PA)
+    NRF_GPIOTE_NS->TASKS_CLR[plna_pa_idx] = 1;
+#endif
+#if MYNEWT_VAL(BLE_LL_LNA)
+    NRF_GPIOTE_NS->TASKS_CLR[plna_lna_idx] = 1;
+#endif
+#endif
+}
+
 int
 ble_phy_get_cur_phy(void)
 {
@@ -1973,7 +1988,7 @@ ble_phy_disable(void)
 
     ble_phy_stop_usec_timer();
     ble_phy_disable_irq_and_ppi();
-
+    ble_phy_plna_force_disable();
     ble_phy_dbg_clear_pins();
 }