From 9f22d249e0c542e34ecc2bf1161904a2ee01e7f4 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Wed, 9 Oct 2019 10:27:25 +0200 Subject: [PATCH] nimble/host: Build ble_hs_periodic_sync only when enabled When periodic advertising support is disabled this code is never used. --- nimble/host/src/ble_hs.c | 2 ++ nimble/host/src/ble_hs_periodic_sync.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/nimble/host/src/ble_hs.c b/nimble/host/src/ble_hs.c index 969a3e1fb..2e5451a99 100644 --- a/nimble/host/src/ble_hs.c +++ b/nimble/host/src/ble_hs.c @@ -743,8 +743,10 @@ ble_hs_init(void) rc = ble_hs_conn_init(); SYSINIT_PANIC_ASSERT(rc == 0); +#if MYNEWT_VAL(BLE_PERIODIC_ADV) rc = ble_hs_periodic_sync_init(); SYSINIT_PANIC_ASSERT(rc == 0); +#endif rc = ble_l2cap_init(); SYSINIT_PANIC_ASSERT(rc == 0); diff --git a/nimble/host/src/ble_hs_periodic_sync.c b/nimble/host/src/ble_hs_periodic_sync.c index 1a77060e1..9fad6533a 100644 --- a/nimble/host/src/ble_hs_periodic_sync.c +++ b/nimble/host/src/ble_hs_periodic_sync.c @@ -24,6 +24,7 @@ #include "host/ble_hs_id.h" #include "ble_hs_priv.h" +#if MYNEWT_VAL(BLE_PERIODIC_ADV) static SLIST_HEAD(, ble_hs_periodic_sync) g_ble_hs_periodic_sync_handles; static struct os_mempool ble_hs_periodic_sync_pool; @@ -150,3 +151,4 @@ ble_hs_periodic_sync_init(void) return 0; } +#endif