Add new API method `attach_s` instead of overloading the deprecated `attach`

pull/11236/head
Hugues Kamba 2019-08-15 15:30:51 +01:00
parent ce5dbda1ba
commit 61b1482b12
2 changed files with 3 additions and 3 deletions

View File

@ -93,12 +93,12 @@ public:
* @param func pointer to the function to be called
* @param t the time between calls in seconds
*/
void attach(Callback<void()> func, const s_timestamp_t t)
void attach_s(Callback<void()> func, const s_timestamp_t t)
{
attach_us(func, SECONDS_TO_MICROSECONDS(t));
}
MBED_DEPRECATED("This function has been deprecated, use attach(Callback<void()> func, const s_timestamp_t t)")
MBED_DEPRECATED("This function has been deprecated, use attach_s(Callback<void()> func, const s_timestamp_t t)")
void attach(Callback<void()> func, float t)
{
attach_us(func, t * 1000000.0f);

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), (s_timestamp_t)timeout);
_timeout.attach_s(callback(this, &NFCController::on_timeout), timeout);
}
void NFCController::on_hw_interrupt()