test

Dependencies:   nrf51-sdk

Dependents:   microbit-dal

Fork of nRF51822 by Lancaster University

Revision:
429:bff56e081b6e
Parent:
426:3edd435c8364
Child:
430:db7edc9ad0bc
--- a/source/btle/btle.cpp	Thu Aug 13 13:23:19 2015 +0100
+++ b/source/btle/btle.cpp	Fri Sep 25 15:26:39 2015 +0100
@@ -50,39 +50,13 @@
     pstorage_sys_event_handler(sys_evt);
 }
 
-/**
- * This function is called in interrupt context to handle BLE events; i.e. pull
- * system and user events out of the pending events-queue of the BLE stack. The
- * BLE stack signals the availability of events by the triggering the SWI2
- * interrupt, which forwards the handling to this function.
- *
- * The event processing loop is implemented in intern_softdevice_events_execute().
- *
- * In mbed OS, a callback for intern_softdevice_events_execute() is posted
- * to the scheduler, which then executes in thread mode. In mbed-classic,
- * event processing happens right-away in interrupt context (which is more
- * risk-prone). In either case, the logic of event processing is identical.
- */
-static uint32_t eventHandler()
-{
-#ifdef YOTTA_CFG_MBED_OS
-    minar::Scheduler::postCallback(intern_softdevice_events_execute);
-#else
-    intern_softdevice_events_execute();
-#endif
-
-    return NRF_SUCCESS;
-}
-
 error_t btle_init(void)
 {
-    nrf_clock_lfclksrc_t clockSource;
     if (NRF_CLOCK->LFCLKSRC & (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos)) {
-        clockSource = NRF_CLOCK_LFCLKSRC_XTAL_20_PPM;
+        SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);
     } else {
-        clockSource = NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION;
+        SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, NULL);
     }
-    SOFTDEVICE_HANDLER_INIT(clockSource, eventHandler);
 
     // Enable BLE stack
     /**
@@ -133,9 +107,7 @@
 
     dm_ble_evt_handler(p_ble_evt);
 
-#if !defined(MCU_NORDIC_16K_S110) && !defined(MCU_NORDIC_32K_S110)
     bleGattcEventHandler(p_ble_evt);
-#endif
 
     /* Custom event handler */
     switch (p_ble_evt->header.evt_id) {