From 26a01e916ede2893ed14bd54b7a10f9c50ac3b22 Mon Sep 17 00:00:00 2001 From: Ladislas de Toldi Date: Tue, 10 May 2022 22:29:21 +0200 Subject: [PATCH] LowPowerTicker - Add ::attach(...) method + call callback --- .../UNITTESTS/doubles/drivers/LowPowerTicker.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/tests/UNITTESTS/doubles/drivers/LowPowerTicker.h b/drivers/tests/UNITTESTS/doubles/drivers/LowPowerTicker.h index 1d0bb6b5da2d..f8a09e6f505c 100644 --- a/drivers/tests/UNITTESTS/doubles/drivers/LowPowerTicker.h +++ b/drivers/tests/UNITTESTS/doubles/drivers/LowPowerTicker.h @@ -28,21 +28,23 @@ namespace mbed { class LowPowerTicker { public: - LowPowerTicker() - { - } + LowPowerTicker() = default; + + virtual ~LowPowerTicker() = default; - virtual ~LowPowerTicker() + void attach(Callback func, std::chrono::microseconds t) { + func(); } void attach_us(Callback func, us_timestamp_t t) { - + func(); } + void detach() { - + // nothing to do } };