mirror of https://github.com/ARMmbed/mbed-os.git
Add new API method `attach_s` instead of overloading the deprecated `attach`
parent
ce5dbda1ba
commit
61b1482b12
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue