mirror of https://github.com/ARMmbed/mbed-os.git
BLE - Nordic implementation: Move singleton into a function.
This change remove BLE code from the binary generated if the user code doesn't use BLE.pull/2778/head
parent
c1c1492fa7
commit
b4ac8f214a
|
|
@ -34,7 +34,11 @@ extern "C" {
|
|||
/**
|
||||
* The singleton which represents the nRF51822 transport for the BLE.
|
||||
*/
|
||||
static nRF5xn deviceInstance;
|
||||
static nRF5xn& getDeviceInstance() {
|
||||
static nRF5xn deviceInstance;
|
||||
return deviceInstance;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* BLE-API requires an implementation of the following function in order to
|
||||
|
|
@ -48,7 +52,7 @@ createBLEInstance(void)
|
|||
|
||||
nRF5xn& nRF5xn::Instance(BLE::InstanceID_t instanceId)
|
||||
{
|
||||
return deviceInstance;
|
||||
return getDeviceInstance();
|
||||
}
|
||||
|
||||
nRF5xn::nRF5xn(void) :
|
||||
|
|
|
|||
Loading…
Reference in New Issue