From 1b58e58e1a56c042f4cd97bdddba561cf40e3f6d Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Wed, 28 Mar 2018 00:25:57 +0200 Subject: [PATCH] Fix deep sleep locking for Timeout class Detach in the Timeout::handler so deep sleep is properly unlocked. --- drivers/Timeout.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/Timeout.cpp b/drivers/Timeout.cpp index 40c7d9f0533..6fc4a7e69bf 100644 --- a/drivers/Timeout.cpp +++ b/drivers/Timeout.cpp @@ -18,7 +18,9 @@ namespace mbed { void Timeout::handler() { - _function.call(); + Callback local = _function; + detach(); + local.call(); } } // namespace mbed