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


The following commit(s) were added to refs/heads/master by this push:
     new 9c3ad284b nimble/ll: Simplify PHY mode setup
9c3ad284b is described below

commit 9c3ad284b2f1e04c8a6ba5ae19cf7c85f685f208
Author: Mariusz Skamra <[email protected]>
AuthorDate: Thu Jan 29 11:23:33 2026 +0100

    nimble/ll: Simplify PHY mode setup
    
    Set phy_mode once and call ble_phy_mode_set() after the
    conditional to avoid duplicated calls.
---
 nimble/controller/src/ble_ll_adv.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/nimble/controller/src/ble_ll_adv.c 
b/nimble/controller/src/ble_ll_adv.c
index 46967c4b3..1b76c6f09 100644
--- a/nimble/controller/src/ble_ll_adv.c
+++ b/nimble/controller/src/ble_ll_adv.c
@@ -1129,7 +1129,7 @@ ble_ll_adv_tx_start_cb(struct ble_ll_sched_item *sch)
     uint8_t end_trans;
     uint32_t txstart;
     struct ble_ll_adv_sm *advsm;
-#if MYNEWT_VAL(BLE_LL_PHY) && MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
+#if MYNEWT_VAL(BLE_LL_PHY)
     uint8_t phy_mode;
 #endif
 
@@ -1159,13 +1159,12 @@ ble_ll_adv_tx_start_cb(struct ble_ll_sched_item *sch)
     phy_mode = ble_ll_phy_to_phy_mode(advsm->pri_phy, 
BLE_HCI_LE_PHY_CODED_ANY);
 #endif
     if (advsm->props & BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY) {
-        ble_phy_mode_set(BLE_PHY_MODE_1M, BLE_PHY_MODE_1M);
-    } else {
-        ble_phy_mode_set(phy_mode, phy_mode);
+        phy_mode = BLE_PHY_MODE_1M;
     }
 #else
-    ble_phy_mode_set(BLE_PHY_MODE_1M, BLE_PHY_MODE_1M);
+    phy_mode = BLE_PHY_MODE_1M;
 #endif
+    ble_phy_mode_set(phy_mode, phy_mode);
 #endif
 
     /* Set the power */

Reply via email to