Skip to content

Commit 4b1cee3

Browse files
committed
Deprecate previous Ticker::attach() API
* Restore previous implementation as deprecated * Ensure method call is unambiguous
1 parent e1714ec commit 4b1cee3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

drivers/Ticker.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ class Ticker : public TimerEvent, private NonCopyable<Ticker> {
8383
attach_us(func, SECONDS_TO_MICROSECONDS(t));
8484
}
8585

86+
MBED_DEPRECATED("This function has been deprecated, use attach(Callback<void()> func, const s_timestamp_t t)")
87+
void attach(Callback<void()> func, float t)
88+
{
89+
attach_us(func, t * 1000000.0f);
90+
}
91+
8692
/** Attach a member function to be called by the Ticker, specifying the interval in seconds
8793
*
8894
* @param obj pointer to the object to call the member function on

features/nfc/source/nfc/NFCController.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void NFCController::scheduler_process(bool hw_interrupt)
183183
// Process stack events
184184
uint32_t timeout = nfc_scheduler_iteration(_scheduler, hw_interrupt ? EVENT_HW_INTERRUPT : EVENT_NONE);
185185

186-
_timeout.attach(callback(this, &NFCController::on_timeout), timeout);
186+
_timeout.attach(callback(this, &NFCController::on_timeout), (s_timestamp_t)timeout);
187187
}
188188

189189
void NFCController::on_hw_interrupt()

0 commit comments

Comments
 (0)