From fb032efa909c9031f75223931fe9701c8cb42f1b Mon Sep 17 00:00:00 2001 From: Vinayak Chettimada Date: Sat, 5 Nov 2016 05:13:51 +0100 Subject: [PATCH] Bluetooth: Controller: Use configured clock source Remove hardcoded use of crystal as 32KHz clock source and 20 ppm accuracy; and use the values from config for sleep clock source and sleep clock accuracy value in Bluetooth Controller. Change-id: I1c0d53ecf8ad158153d5186a6680b5eb03d1641b Signed-off-by: Vinayak Chettimada --- subsys/bluetooth/controller/hci/hci_driver.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/hci/hci_driver.c b/subsys/bluetooth/controller/hci/hci_driver.c index c656acf1910..ad95d046a67 100644 --- a/subsys/bluetooth/controller/hci/hci_driver.c +++ b/subsys/bluetooth/controller/hci/hci_driver.c @@ -34,6 +34,10 @@ #include #include +#ifdef CONFIG_CLOCK_CONTROL_NRF5 +#include +#endif + #include "util/defines.h" #include "util/work.h" #include "hal/rand.h" @@ -269,7 +273,7 @@ static int hci_driver_open(void) return -ENODEV; } - clock_control_on(clk_k32, (void *)1); + clock_control_on(clk_k32, (void *)CLOCK_CONTROL_NRF5_K32SRC); _ticker_users[RADIO_TICKER_USER_ID_WORKER][0] = RADIO_TICKER_USER_WORKER_OPS; @@ -292,7 +296,7 @@ static int hci_driver_open(void) } err = radio_init(clk_m16, - 7, /* 20ppm = 7 ... 250ppm = 1, 500ppm = 0 */ + CLOCK_CONTROL_NRF5_K32SRC_ACCURACY, RADIO_CONNECTION_CONTEXT_MAX, RADIO_PACKET_COUNT_RX_MAX, RADIO_PACKET_COUNT_TX_MAX,