diff --git a/drivers/LowPowerTicker.h b/drivers/LowPowerTicker.h index 09ce9ec..16e69dc 100644 --- a/drivers/LowPowerTicker.h +++ b/drivers/LowPowerTicker.h @@ -40,11 +40,8 @@ * @note Synchronization level: Interrupt safe */ class LowPowerTicker : public TickerBase { - public: - LowPowerTicker() : TickerBase(get_lp_ticker_data()) - { - } + LowPowerTicker(); }; /** @}*/ diff --git a/drivers/LowPowerTimer.h b/drivers/LowPowerTimer.h index 2000ef9..d62677b 100644 --- a/drivers/LowPowerTimer.h +++ b/drivers/LowPowerTimer.h @@ -37,12 +37,8 @@ * @note Synchronization level: Interrupt safe */ class LowPowerTimer : public TimerBase { - public: - LowPowerTimer() : TimerBase(get_lp_ticker_data()) - { - } - + LowPowerTimer(); }; /** @}*/ diff --git a/drivers/source/Ticker.cpp b/drivers/source/Ticker.cpp index 68f1286..5a37b0e 100644 --- a/drivers/source/Ticker.cpp +++ b/drivers/source/Ticker.cpp @@ -15,8 +15,10 @@ * limitations under the License. */ #include "drivers/Ticker.h" +#include "drivers/LowPowerTicker.h" #include "hal/us_ticker_api.h" +#include "hal/lp_ticker_api.h" #include "platform/CriticalSectionLock.h" #include "platform/mbed_power_mgmt.h" @@ -103,4 +105,10 @@ { } +#if DEVICE_LPTICKER +LowPowerTicker::LowPowerTicker() : TickerBase(get_lp_ticker_data(), false) +{ +} +#endif + } // namespace mbed diff --git a/drivers/source/Timeout.cpp b/drivers/source/Timeout.cpp index 4b77468..c6000a8 100644 --- a/drivers/source/Timeout.cpp +++ b/drivers/source/Timeout.cpp @@ -39,6 +39,12 @@ { } +#if DEVICE_LPTICKER +LowPowerTimeout::LowPowerTimeout() : TimeoutBase(get_lp_ticker_data(), false) +{ +} +#endif + /* A few miscellaneous out-of-line static members from various related classes, * just to save them getting needing their own cpp file for one line. * (In C++17 could avoid the need for this by making the members inline). @@ -49,10 +55,4 @@ #endif const bool RealTimeClock::is_steady; -#if DEVICE_LPTICKER -LowPowerTimeout::LowPowerTimeout() : TimeoutBase(get_lp_ticker_data(), true) -{ -} -#endif - } // namespace mbed diff --git a/drivers/source/Timer.cpp b/drivers/source/Timer.cpp index 233731c..3b34490 100644 --- a/drivers/source/Timer.cpp +++ b/drivers/source/Timer.cpp @@ -15,8 +15,10 @@ * limitations under the License. */ #include "drivers/Timer.h" +#include "drivers/LowPowerTimer.h" #include "hal/ticker_api.h" #include "hal/us_ticker_api.h" +#include "hal/lp_ticker_api.h" #include "platform/CriticalSectionLock.h" #include "platform/mbed_critical.h" #include "platform/mbed_power_mgmt.h" @@ -121,4 +123,10 @@ { } +#if DEVICE_LPTICKER +LowPowerTimer::LowPowerTimer() : TimerBase(get_lp_ticker_data(), false) +{ +} +#endif + } // namespace mbed