From 80ae4502b6612eebfe8a25147b65e76e2d12f8f2 Mon Sep 17 00:00:00 2001 From: CarlWachter Date: Sun, 3 Nov 2024 14:57:27 +0100 Subject: [PATCH] fix(statemachine): perform manager roles and call callback when transition is forced --- src/statemachine.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/statemachine.cpp b/src/statemachine.cpp index 03c5f51..e84c614 100644 --- a/src/statemachine.cpp +++ b/src/statemachine.cpp @@ -130,6 +130,16 @@ namespace sta { setLockoutTimer(lockout); } + + // get heap stats at the end of the state transition + HeapStats_t stats; + vPortGetHeapStats(&stats); + + // Execute the user-defined callback. + sta::tacos::onStateTransition(transition.from, transition.to, transition.lockout); + + // Start all new tasks and stop all the tasks that aren't supposed to be running. + updateThreads(); } }