Skip to content

Commit 81591b0

Browse files
committed
Fix deep sleep locking for Timeout class
Detach in the Timeout::handler so deep sleep is properly unlocked.
1 parent eecc67b commit 81591b0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/Timeout.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
namespace mbed {
1919

2020
void Timeout::handler() {
21-
_function.call();
21+
Callback<void()> local = _function;
22+
detach();
23+
local.call();
2224
}
2325

2426
} // namespace mbed

0 commit comments

Comments
 (0)