diff --git a/Sming/Core/CallbackTimer.h b/Sming/Core/CallbackTimer.h index e8ef1989ac..9844c6ed86 100644 --- a/Sming/Core/CallbackTimer.h +++ b/Sming/Core/CallbackTimer.h @@ -207,7 +207,18 @@ template class CallbackTimer : protected TimerApi * @param repeating True to restart timer when it triggers, false for one-shot (Default: true) * @retval bool True if timer started */ - IRAM_ATTR bool start(bool repeating = true); + __forceinline bool IRAM_ATTR start(bool repeating = true) + { + stop(); + if(!callbackSet || !intervalSet) { + return false; + } + + TimerApi::arm(repeating); + started = true; + this->repeating = repeating; + return true; + } /** @brief Start one-shot timer * @retval bool True if timer started @@ -410,17 +421,4 @@ template class CallbackTimer : protected TimerApi bool started = false; ///< Timer is active, or has fired }; -template bool CallbackTimer::start(bool repeating) -{ - stop(); - if(!callbackSet || !intervalSet) { - return false; - } - - TimerApi::arm(repeating); - started = true; - this->repeating = repeating; - return true; -} - /** @} */