Skip to content

Commit 0286e3c

Browse files
authored
Merge pull request #12525 from rajkan01/ticker_remove_deprecated
Remove the deprecated Ticker APIs
2 parents 272c42d + db0bf08 commit 0286e3c

File tree

2 files changed

+3
-37
lines changed
  • drivers
  • features/frameworks/utest/TESTS/unit_tests/case_control_async

2 files changed

+3
-37
lines changed

drivers/Ticker.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,6 @@ class Ticker : public TimerEvent, private NonCopyable<Ticker> {
9393
attach_us(std::forward<F>(func), t * 1000000.0f);
9494
}
9595

96-
/** Attach a member function to be called by the Ticker, specifying the interval in seconds
97-
*
98-
* @param obj pointer to the object to call the member function on
99-
* @param method pointer to the member function to be called
100-
* @param t the time between calls in seconds
101-
* @deprecated
102-
* The attach function does not support cv-qualifiers. Replaced by
103-
* attach(callback(obj, method), t).
104-
*/
105-
template<typename T, typename M>
106-
MBED_DEPRECATED_SINCE("mbed-os-5.1",
107-
"The attach function does not support cv-qualifiers. Replaced by "
108-
"attach(callback(obj, method), t).")
109-
void attach(T *obj, M method, float t)
110-
{
111-
attach(callback(obj, method), t);
112-
}
11396

11497
/** Attach a function to be called by the Ticker, specifying the interval in microseconds
11598
*
@@ -123,23 +106,6 @@ class Ticker : public TimerEvent, private NonCopyable<Ticker> {
123106
*/
124107
void attach_us(Callback<void()> func, us_timestamp_t t);
125108

126-
/** Attach a member function to be called by the Ticker, specifying the interval in microseconds
127-
*
128-
* @param obj pointer to the object to call the member function on
129-
* @param method pointer to the member function to be called
130-
* @param t the time between calls in microseconds
131-
* @deprecated
132-
* The attach_us function does not support cv-qualifiers. Replaced by
133-
* attach_us(callback(obj, method), t).
134-
*/
135-
template<typename T, typename M>
136-
MBED_DEPRECATED_SINCE("mbed-os-5.1",
137-
"The attach_us function does not support cv-qualifiers. Replaced by "
138-
"attach_us(callback(obj, method), t).")
139-
void attach_us(T *obj, M method, us_timestamp_t t)
140-
{
141-
attach_us(Callback<void()>(obj, method), t);
142-
}
143109

144110
virtual ~Ticker()
145111
{

features/frameworks/utest/TESTS/unit_tests/case_control_async/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ control_t await_case(const size_t call_count)
118118
TEST_ASSERT_EQUAL(1, call_count);
119119
TEST_ASSERT_EQUAL(6, call_counter++);
120120

121-
utest_to.attach_us(&validate1, &Utest_func_bind::callback, (1372*1000)); // Fire after 1372 ms
121+
utest_to.attach_us(callback(&validate1, &Utest_func_bind::callback), (1372*1000)); // Fire after 1372 ms
122122

123123
return CaseAwait;
124124
}
@@ -146,7 +146,7 @@ control_t repeat_all_on_timeout_case(const size_t call_count)
146146
TEST_ASSERT(call_count <= 10);
147147
TEST_ASSERT_EQUAL((call_count-1)*3 + 9, call_counter++);
148148
if (call_count == 10) {
149-
utest_to.attach_us(&validate2, &Utest_func_bind::callback, (50*1000)); // Fire after 50ms
149+
utest_to.attach_us(callback(&validate2, &Utest_func_bind::callback), (50*1000)); // Fire after 50ms
150150
}
151151
return CaseRepeatAllOnTimeout(100);
152152
}
@@ -181,7 +181,7 @@ control_t repeat_handler_on_timeout_case(const size_t call_count)
181181
TEST_ASSERT(call_count <= 10);
182182
TEST_ASSERT_EQUAL(call_count-1 + 40, call_counter++);
183183
if (call_count == 10) {
184-
utest_to.attach_us(&validate3, &Utest_func_bind::callback, (50*1000)); // Fire after 50ms
184+
utest_to.attach_us(callback(&validate3, &Utest_func_bind::callback), (50*1000)); // Fire after 50ms
185185
}
186186
return CaseRepeatHandlerOnTimeout(100);
187187
}

0 commit comments

Comments
 (0)