Remove the deprecated Ticker APIs

pull/12525/head
Rajkumar Kanagaraj 2020-02-27 03:26:12 -08:00
parent a745525a54
commit db0bf08e4d
2 changed files with 3 additions and 37 deletions

View File

@ -93,23 +93,6 @@ public:
attach_us(std::forward<F>(func), t * 1000000.0f);
}
/** Attach a member function to be called by the Ticker, specifying the interval in seconds
*
* @param obj pointer to the object to call the member function on
* @param method pointer to the member function to be called
* @param t the time between calls in seconds
* @deprecated
* The attach function does not support cv-qualifiers. Replaced by
* attach(callback(obj, method), t).
*/
template<typename T, typename M>
MBED_DEPRECATED_SINCE("mbed-os-5.1",
"The attach function does not support cv-qualifiers. Replaced by "
"attach(callback(obj, method), t).")
void attach(T *obj, M method, float t)
{
attach(callback(obj, method), t);
}
/** Attach a function to be called by the Ticker, specifying the interval in microseconds
*
@ -123,23 +106,6 @@ public:
*/
void attach_us(Callback<void()> func, us_timestamp_t t);
/** Attach a member function to be called by the Ticker, specifying the interval in microseconds
*
* @param obj pointer to the object to call the member function on
* @param method pointer to the member function to be called
* @param t the time between calls in microseconds
* @deprecated
* The attach_us function does not support cv-qualifiers. Replaced by
* attach_us(callback(obj, method), t).
*/
template<typename T, typename M>
MBED_DEPRECATED_SINCE("mbed-os-5.1",
"The attach_us function does not support cv-qualifiers. Replaced by "
"attach_us(callback(obj, method), t).")
void attach_us(T *obj, M method, us_timestamp_t t)
{
attach_us(Callback<void()>(obj, method), t);
}
virtual ~Ticker()
{

View File

@ -118,7 +118,7 @@ control_t await_case(const size_t call_count)
TEST_ASSERT_EQUAL(1, call_count);
TEST_ASSERT_EQUAL(6, call_counter++);
utest_to.attach_us(&validate1, &Utest_func_bind::callback, (1372*1000)); // Fire after 1372 ms
utest_to.attach_us(callback(&validate1, &Utest_func_bind::callback), (1372*1000)); // Fire after 1372 ms
return CaseAwait;
}
@ -146,7 +146,7 @@ control_t repeat_all_on_timeout_case(const size_t call_count)
TEST_ASSERT(call_count <= 10);
TEST_ASSERT_EQUAL((call_count-1)*3 + 9, call_counter++);
if (call_count == 10) {
utest_to.attach_us(&validate2, &Utest_func_bind::callback, (50*1000)); // Fire after 50ms
utest_to.attach_us(callback(&validate2, &Utest_func_bind::callback), (50*1000)); // Fire after 50ms
}
return CaseRepeatAllOnTimeout(100);
}
@ -181,7 +181,7 @@ control_t repeat_handler_on_timeout_case(const size_t call_count)
TEST_ASSERT(call_count <= 10);
TEST_ASSERT_EQUAL(call_count-1 + 40, call_counter++);
if (call_count == 10) {
utest_to.attach_us(&validate3, &Utest_func_bind::callback, (50*1000)); // Fire after 50ms
utest_to.attach_us(callback(&validate3, &Utest_func_bind::callback), (50*1000)); // Fire after 50ms
}
return CaseRepeatHandlerOnTimeout(100);
}