nordic

Fork of nRF51822 by Nordic Semiconductor

Revision:
403:448a564f5c9e
Parent:
400:a471c3da4806
Child:
405:fccbe137c4ac
diff -r bd0f4eaad9f0 -r 448a564f5c9e source/btle/btle.cpp
--- a/source/btle/btle.cpp	Fri Aug 07 15:57:07 2015 +0100
+++ b/source/btle/btle.cpp	Fri Aug 07 15:57:07 2015 +0100
@@ -52,11 +52,10 @@
 
 error_t btle_init(void)
 {
-#if defined(TARGET_DELTA_DFCM_NNN40) || defined(TARGET_HRM1017)
-    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, NULL);
-#else
-    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);
-#endif
+    if (NRF_CLOCK->LFCLKSRC & (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos))
+        SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);
+    else
+        SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, NULL);
 
     // Enable BLE stack
     /**