We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4ac8f2 commit e8bddd6Copy full SHA for e8bddd6
features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/nRF5xn.cpp
@@ -33,7 +33,11 @@ extern "C" {
33
/**
34
* The singleton which represents the nRF51822 transport for the BLE.
35
*/
36
-static nRF5xn deviceInstance;
+static nRF5xn& getDeviceInstance() {
37
+ static nRF5xn deviceInstance;
38
+ return deviceInstance;
39
+}
40
+
41
42
43
* BLE-API requires an implementation of the following function in order to
@@ -47,7 +51,7 @@ createBLEInstance(void)
47
51
48
52
nRF5xn& nRF5xn::Instance(BLE::InstanceID_t instanceId)
49
53
{
50
- return deviceInstance;
54
+ return getDeviceInstance();
55
}
56
57
nRF5xn::nRF5xn(void) :
0 commit comments