Skip to content

Commit 6912a9d

Browse files
Merge pull request #5393 from c1728p9/call_chain_deprecation
Deprecate CallChain and InterruptManager
2 parents 3a05b63 + 891b06e commit 6912a9d

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed

drivers/InterruptManager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
#include "cmsis.h"
1717
#if defined(NVIC_NUM_VECTORS)
1818

19+
// Suppress deprecation warnings since this whole
20+
// class is deprecated already
21+
#include "mbed_toolchain.h"
22+
#undef MBED_DEPRECATED_SINCE
23+
#define MBED_DEPRECATED_SINCE(...)
24+
1925
#include "drivers/InterruptManager.h"
2026
#include "platform/mbed_critical.h"
2127
#include <string.h>

drivers/InterruptManager.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,14 @@ class InterruptManager : private NonCopyable<InterruptManager> {
6060
*
6161
* @return the only instance of this class
6262
*/
63+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
64+
"public API of mbed-os and is being removed in the future.")
6365
static InterruptManager* get();
6466

6567
/** Destroy the current instance of the interrupt manager
6668
*/
69+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
70+
"public API of mbed-os and is being removed in the future.")
6771
static void destroy();
6872

6973
/** Add a handler for an interrupt at the end of the handler list
@@ -74,6 +78,8 @@ class InterruptManager : private NonCopyable<InterruptManager> {
7478
* @returns
7579
* The function object created for 'function'
7680
*/
81+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
82+
"public API of mbed-os and is being removed in the future.")
7783
pFunctionPointer_t add_handler(void (*function)(void), IRQn_Type irq) {
7884
// Underlying call is thread safe
7985
return add_common(function, irq);
@@ -87,6 +93,8 @@ class InterruptManager : private NonCopyable<InterruptManager> {
8793
* @returns
8894
* The function object created for 'function'
8995
*/
96+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
97+
"public API of mbed-os and is being removed in the future.")
9098
pFunctionPointer_t add_handler_front(void (*function)(void), IRQn_Type irq) {
9199
// Underlying call is thread safe
92100
return add_common(function, irq, true);
@@ -102,6 +110,8 @@ class InterruptManager : private NonCopyable<InterruptManager> {
102110
* The function object created for 'tptr' and 'mptr'
103111
*/
104112
template<typename T>
113+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
114+
"public API of mbed-os and is being removed in the future.")
105115
pFunctionPointer_t add_handler(T* tptr, void (T::*mptr)(void), IRQn_Type irq) {
106116
// Underlying call is thread safe
107117
return add_common(tptr, mptr, irq);
@@ -117,6 +127,8 @@ class InterruptManager : private NonCopyable<InterruptManager> {
117127
* The function object created for 'tptr' and 'mptr'
118128
*/
119129
template<typename T>
130+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
131+
"public API of mbed-os and is being removed in the future.")
120132
pFunctionPointer_t add_handler_front(T* tptr, void (T::*mptr)(void), IRQn_Type irq) {
121133
// Underlying call is thread safe
122134
return add_common(tptr, mptr, irq, true);
@@ -130,6 +142,8 @@ class InterruptManager : private NonCopyable<InterruptManager> {
130142
* @returns
131143
* true if the handler was found and removed, false otherwise
132144
*/
145+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
146+
"public API of mbed-os and is being removed in the future.")
133147
bool remove_handler(pFunctionPointer_t handler, IRQn_Type irq);
134148

135149
private:

platform/CallChain.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2+
// Suppress deprecation warnings since this whole
3+
// class is deprecated already
4+
#include "mbed_toolchain.h"
5+
#undef MBED_DEPRECATED_SINCE
6+
#define MBED_DEPRECATED_SINCE(...)
7+
18
#include "platform/CallChain.h"
29
#include "cmsis.h"
310
#include "platform/mbed_critical.h"

platform/CallChain.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ class CallChain : private NonCopyable<CallChain> {
7272
*
7373
* @param size (optional) Initial size of the chain
7474
*/
75+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
76+
"public API of mbed-os and is being removed in the future.")
7577
CallChain(int size = 4);
78+
79+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
80+
"public API of mbed-os and is being removed in the future.")
7681
virtual ~CallChain();
7782

7883
/** Add a function at the end of the chain
@@ -82,6 +87,8 @@ class CallChain : private NonCopyable<CallChain> {
8287
* @returns
8388
* The function object created for 'func'
8489
*/
90+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
91+
"public API of mbed-os and is being removed in the future.")
8592
pFunctionPointer_t add(Callback<void()> func);
8693

8794
/** Add a function at the end of the chain
@@ -111,6 +118,8 @@ class CallChain : private NonCopyable<CallChain> {
111118
* @returns
112119
* The function object created for 'func'
113120
*/
121+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
122+
"public API of mbed-os and is being removed in the future.")
114123
pFunctionPointer_t add_front(Callback<void()> func);
115124

116125
/** Add a function at the beginning of the chain
@@ -135,6 +144,8 @@ class CallChain : private NonCopyable<CallChain> {
135144

136145
/** Get the number of functions in the chain
137146
*/
147+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
148+
"public API of mbed-os and is being removed in the future.")
138149
int size() const;
139150

140151
/** Get a function object from the chain
@@ -144,6 +155,8 @@ class CallChain : private NonCopyable<CallChain> {
144155
* @returns
145156
* The function object at position 'i' in the chain
146157
*/
158+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
159+
"public API of mbed-os and is being removed in the future.")
147160
pFunctionPointer_t get(int i) const;
148161

149162
/** Look for a function object in the call chain
@@ -153,10 +166,14 @@ class CallChain : private NonCopyable<CallChain> {
153166
* @returns
154167
* The index of the function object if found, -1 otherwise.
155168
*/
169+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
170+
"public API of mbed-os and is being removed in the future.")
156171
int find(pFunctionPointer_t f) const;
157172

158173
/** Clear the call chain (remove all functions in the chain).
159174
*/
175+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
176+
"public API of mbed-os and is being removed in the future.")
160177
void clear();
161178

162179
/** Remove a function object from the chain
@@ -166,15 +183,24 @@ class CallChain : private NonCopyable<CallChain> {
166183
* @returns
167184
* true if the function object was found and removed, false otherwise.
168185
*/
186+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
187+
"public API of mbed-os and is being removed in the future.")
169188
bool remove(pFunctionPointer_t f);
170189

171190
/** Call all the functions in the chain in sequence
172191
*/
192+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
193+
"public API of mbed-os and is being removed in the future.")
173194
void call();
174195

196+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
197+
"public API of mbed-os and is being removed in the future.")
175198
void operator ()(void) {
176199
call();
177200
}
201+
202+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
203+
"public API of mbed-os and is being removed in the future.")
178204
pFunctionPointer_t operator [](int i) const {
179205
return get(i);
180206
}

0 commit comments

Comments
 (0)