From 86f34b365375b42279febb20fd744da00f9f1118 Mon Sep 17 00:00:00 2001 From: Niclas Hoyer Date: Fri, 21 Oct 2022 01:10:12 +0200 Subject: fix scheduled tasks scheduling another task --- movement/movement.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/movement/movement.c b/movement/movement.c index 8c58b202..e904687c 100644 --- a/movement/movement.c +++ b/movement/movement.c @@ -159,6 +159,10 @@ static void _movement_handle_scheduled_tasks(void) { scheduled_tasks[i].reg = 0; movement_event_t background_event = { EVENT_BACKGROUND_TASK, 0 }; watch_faces[i].loop(background_event, &movement_state.settings, watch_face_contexts[i]); + // check if loop scheduled a new task + if (scheduled_tasks[i].reg) { + num_active_tasks++; + } } else { num_active_tasks++; } -- cgit v1.2.3