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 c1c1492 commit b4ac8f2Copy full SHA for b4ac8f2
features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xn.cpp
@@ -34,7 +34,11 @@ extern "C" {
34
/**
35
* The singleton which represents the nRF51822 transport for the BLE.
36
*/
37
-static nRF5xn deviceInstance;
+static nRF5xn& getDeviceInstance() {
38
+ static nRF5xn deviceInstance;
39
+ return deviceInstance;
40
+}
41
+
42
43
44
* BLE-API requires an implementation of the following function in order to
@@ -48,7 +52,7 @@ createBLEInstance(void)
48
52
49
53
nRF5xn& nRF5xn::Instance(BLE::InstanceID_t instanceId)
50
54
{
51
- return deviceInstance;
55
+ return getDeviceInstance();
56
}
57
58
nRF5xn::nRF5xn(void) :
0 commit comments