diff --git a/drivers/Ticker.cpp b/drivers/Ticker.cpp index feb27ef57b..b9540ec0fd 100644 --- a/drivers/Ticker.cpp +++ b/drivers/Ticker.cpp @@ -53,4 +53,16 @@ void Ticker::handler() } } +void Ticker::attach_us(Callback func, us_timestamp_t t) +{ + core_util_critical_section_enter(); + // lock only for the initial callback setup and this is not low power ticker + if (!_function && _lock_deepsleep) { + sleep_manager_lock_deep_sleep(); + } + _function = func; + setup(t); + core_util_critical_section_exit(); +} + } // namespace mbed diff --git a/drivers/Ticker.h b/drivers/Ticker.h index 31ce72cfad..e6fbf711de 100644 --- a/drivers/Ticker.h +++ b/drivers/Ticker.h @@ -117,17 +117,7 @@ public: * for threads scheduling. * */ - void attach_us(Callback func, us_timestamp_t t) - { - core_util_critical_section_enter(); - // lock only for the initial callback setup and this is not low power ticker - if (!_function && _lock_deepsleep) { - sleep_manager_lock_deep_sleep(); - } - _function = func; - setup(t); - core_util_critical_section_exit(); - } + void attach_us(Callback func, us_timestamp_t t); /** Attach a member function to be called by the Ticker, specifying the interval in microseconds *