Deprecate previous Ticker::attach() API

* Restore previous implementation as deprecated
* Ensure method call is unambiguous
pull/11236/head
Hugues Kamba 2019-08-15 14:52:28 +01:00
parent e1714ec53a
commit 4b1cee3cf3
2 changed files with 7 additions and 1 deletions

View File

@ -83,6 +83,12 @@ public:
attach_us(func, SECONDS_TO_MICROSECONDS(t));
}
MBED_DEPRECATED("This function has been deprecated, use attach(Callback<void()> func, const s_timestamp_t t)")
void attach(Callback<void()> func, float t)
{
attach_us(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

View File

@ -183,7 +183,7 @@ void NFCController::scheduler_process(bool hw_interrupt)
// Process stack events
uint32_t timeout = nfc_scheduler_iteration(_scheduler, hw_interrupt ? EVENT_HW_INTERRUPT : EVENT_NONE);
_timeout.attach(callback(this, &NFCController::on_timeout), timeout);
_timeout.attach(callback(this, &NFCController::on_timeout), (s_timestamp_t)timeout);
}
void NFCController::on_hw_interrupt()