File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
features/FEATURE_BLE/targets/TARGET_NORDIC
TARGET_MCU_NRF51822/source Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,11 @@ extern "C" {
33
33
/* *
34
34
* The singleton which represents the nRF51822 transport for the BLE.
35
35
*/
36
- static nRF5xn deviceInstance;
36
+ static nRF5xn& getDeviceInstance () {
37
+ static nRF5xn deviceInstance;
38
+ return deviceInstance;
39
+ }
40
+
37
41
38
42
/* *
39
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 () ;
51
55
}
52
56
53
57
nRF5xn::nRF5xn (void ) :
Original file line number Diff line number Diff line change @@ -34,7 +34,11 @@ extern "C" {
34
34
/* *
35
35
* The singleton which represents the nRF51822 transport for the BLE.
36
36
*/
37
- static nRF5xn deviceInstance;
37
+ static nRF5xn& getDeviceInstance () {
38
+ static nRF5xn deviceInstance;
39
+ return deviceInstance;
40
+ }
41
+
38
42
39
43
/* *
40
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 () ;
52
56
}
53
57
54
58
nRF5xn::nRF5xn (void ) :
You can’t perform that action at this time.
0 commit comments