Skip to content

Commit fb39848

Browse files
committed
BLE - Cleanup deprecation implementation bits in BLE.cpp
1 parent 7796e73 commit fb39848

File tree

1 file changed

+7
-28
lines changed

1 file changed

+7
-28
lines changed

features/FEATURE_BLE/source/BLE.cpp

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "ble/BLE.h"
1919
#include "ble/BLEInstanceBase.h"
2020
#include "platform/mbed_critical.h"
21+
#include "Deprecated.h"
2122

2223
#if defined(TARGET_OTA_ENABLED)
2324
#include "ble/services/DFUService.h"
@@ -32,28 +33,6 @@
3233
#include <mbed_toolchain.h>
3334
#endif
3435

35-
#if defined(__GNUC__) && !defined(__CC_ARM)
36-
#define BLE_DEPRECATED_API_USE_BEGIN \
37-
_Pragma("GCC diagnostic push") \
38-
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
39-
#elif defined(__CC_ARM)
40-
#define BLE_DEPRECATED_API_USE_BEGIN \
41-
_Pragma("push") \
42-
_Pragma("diag_suppress 1361")
43-
#else
44-
#define BLE_DEPRECATED_API_USE_BEGIN
45-
#endif
46-
47-
#if defined(__GNUC__) && !defined(__CC_ARM)
48-
#define BLE_DEPRECATED_API_USE_END \
49-
_Pragma("GCC diagnostic pop")
50-
#elif defined(__CC_ARM)
51-
#define BLE_DEPRECATED_API_USE_END \
52-
_Pragma("pop")
53-
#else
54-
#define BLE_DEPRECATED_API_USE_END
55-
#endif
56-
5736
static const char* error_strings[] = {
5837
"BLE_ERROR_NONE: No error",
5938
"BLE_ERROR_BUFFER_OVERFLOW: The requested action would cause a buffer overflow and has been aborted",
@@ -167,18 +146,18 @@ BLE::Instance(InstanceID_t id)
167146
static BLE *singletons[NUM_INSTANCES];
168147
if (id < NUM_INSTANCES) {
169148
if (singletons[id] == NULL) {
170-
BLE_DEPRECATED_API_USE_BEGIN
149+
BLE_DEPRECATED_API_USE_BEGIN()
171150
singletons[id] = new BLE(id); /* This object will never be freed. */
172-
BLE_DEPRECATED_API_USE_END
151+
BLE_DEPRECATED_API_USE_END()
173152
}
174153

175154
return *singletons[id];
176155
}
177156

178157
/* we come here only in the case of a bad interfaceID. */
179-
BLE_DEPRECATED_API_USE_BEGIN
158+
BLE_DEPRECATED_API_USE_BEGIN()
180159
static BLE badSingleton(NUM_INSTANCES /* this is a bad index; and will result in a NULL transport. */);
181-
BLE_DEPRECATED_API_USE_END
160+
BLE_DEPRECATED_API_USE_END()
182161
return badSingleton;
183162
}
184163

@@ -352,7 +331,7 @@ void BLE::signalEventsToProcess()
352331

353332
// start of deprecated functions
354333

355-
BLE_DEPRECATED_API_USE_BEGIN
334+
BLE_DEPRECATED_API_USE_BEGIN()
356335

357336
// NOTE: move and remove deprecation once private
358337
BLE::BLE(InstanceID_t instanceIDIn) : instanceID(instanceIDIn), transport(),
@@ -519,5 +498,5 @@ void BLE::onRadioNotification(void (*callback)(bool)) {
519498
}
520499

521500

522-
BLE_DEPRECATED_API_USE_END
501+
BLE_DEPRECATED_API_USE_END()
523502

0 commit comments

Comments
 (0)