Skip to content
This repository was archived by the owner on Mar 2, 2023. It is now read-only.

Commit 26a01e9

Browse files
committed
LowPowerTicker - Add ::attach(...) method + call callback
1 parent d5506b0 commit 26a01e9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

drivers/tests/UNITTESTS/doubles/drivers/LowPowerTicker.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,23 @@ namespace mbed {
2828
class LowPowerTicker {
2929

3030
public:
31-
LowPowerTicker()
32-
{
33-
}
31+
LowPowerTicker() = default;
32+
33+
virtual ~LowPowerTicker() = default;
3434

35-
virtual ~LowPowerTicker()
35+
void attach(Callback<void()> func, std::chrono::microseconds t)
3636
{
37+
func();
3738
}
3839

3940
void attach_us(Callback<void()> func, us_timestamp_t t)
4041
{
41-
42+
func();
4243
}
44+
4345
void detach()
4446
{
45-
47+
// nothing to do
4648
}
4749
};
4850

0 commit comments

Comments
 (0)