From 682af0e06a93cbdfb747ff6c37342878d21c71fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Thu, 10 Apr 2025 09:22:43 +0200 Subject: [PATCH] mgmt: hawkbit: also clear in the call of hawkbit_autohandler() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the k_event_clear in the work might be to late sometimes, when hawkbit_autohandler_wait() is executed directly after hawkbit_autohandler(). This leads to getting the events of the former execution and also not waiting until the current autohandler run is finished. Signed-off-by: Fin Maaß (cherry picked from commit e59451a75821a1d40ca9e359bc55fa032eb967a2) --- subsys/mgmt/hawkbit/hawkbit_autohandler.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsys/mgmt/hawkbit/hawkbit_autohandler.c b/subsys/mgmt/hawkbit/hawkbit_autohandler.c index 3b2dfa7719f98..bba9ab55372c0 100644 --- a/subsys/mgmt/hawkbit/hawkbit_autohandler.c +++ b/subsys/mgmt/hawkbit/hawkbit_autohandler.c @@ -119,6 +119,8 @@ int hawkbit_autohandler_set_delay(k_timeout_t timeout, bool if_bigger) void hawkbit_autohandler(bool auto_reschedule) { + k_event_clear(&hawkbit_autohandler_event, UINT32_MAX); + if (auto_reschedule) { k_work_reschedule(&hawkbit_work_handle, K_NO_WAIT); } else {