From 61b1482b122a4d80ac54a6edfbc5748588c724dc Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Thu, 15 Aug 2019 15:30:51 +0100 Subject: [PATCH] Add new API method `attach_s` instead of overloading the deprecated `attach` --- drivers/Ticker.h | 4 ++-- features/nfc/source/nfc/NFCController.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/Ticker.h b/drivers/Ticker.h index 2040c4c5dd..b4a7b04b06 100644 --- a/drivers/Ticker.h +++ b/drivers/Ticker.h @@ -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 func, const s_timestamp_t t) + void attach_s(Callback func, const s_timestamp_t t) { attach_us(func, SECONDS_TO_MICROSECONDS(t)); } - MBED_DEPRECATED("This function has been deprecated, use attach(Callback func, const s_timestamp_t t)") + MBED_DEPRECATED("This function has been deprecated, use attach_s(Callback func, const s_timestamp_t t)") void attach(Callback func, float t) { attach_us(func, t * 1000000.0f); diff --git a/features/nfc/source/nfc/NFCController.cpp b/features/nfc/source/nfc/NFCController.cpp index 091a6f0e87..e59cf53318 100644 --- a/features/nfc/source/nfc/NFCController.cpp +++ b/features/nfc/source/nfc/NFCController.cpp @@ -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()