ARMmbed / ble-nrf51822

Nordic stack and drivers for the mbed BLE_API
Other
46 stars 51 forks source link

Select the LF clock source dynamically on SoftDevice initialisation #31

Closed jpbrucker closed 9 years ago

jpbrucker commented 9 years ago

Note: this patch refers to the following pull request: https://github.com/mbedmicro/mbed/pull/1276 If that change gets merged into mbed, this patch will be necessary for a proper clock source compatibility. Otherwise, #ifdef can be kept to select the oscillator in btle_init, but the tested macro will need to be changed to TARGET_NRF_LFCLK_RC.

Instead of relying on build macros to know which oscillator we're supposedly using, check the value of LFCLKSRC register. This way, we can trust mbed's init code to fallback on the internal clock if the user specified a wrong target. This change, along with the mbed patch that selects clock source dynamically, will allow lots of application to still run and provide FOTA, when the wrong Nordic platform is specified.

rgrover commented 9 years ago

could you resubmit this against the develop branch? thanks.

rgrover commented 9 years ago

merged into develop.