mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #2778 from pan-/avoid_inclusion_of_ble_code_if_not_used
BLE - Nordic implementation: Move singleton into a function.pull/2663/merge
commit
d8efe713e7
|
@ -33,7 +33,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
|
||||
|
@ -47,7 +51,7 @@ createBLEInstance(void)
|
|||
|
||||
nRF5xn& nRF5xn::Instance(BLE::InstanceID_t instanceId)
|
||||
{
|
||||
return deviceInstance;
|
||||
return getDeviceInstance();
|
||||
}
|
||||
|
||||
nRF5xn::nRF5xn(void) :
|
||||
|
|
|
@ -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