From 4feb697b899e25dd948e8ff70bebc1180c0ad8b1 Mon Sep 17 00:00:00 2001 From: David Crocker Date: Mon, 8 Aug 2022 08:23:26 +0100 Subject: [PATCH] Added function SetCurrentTaskPriority --- src/RTOSIface/RTOSIface.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/RTOSIface/RTOSIface.h b/src/RTOSIface/RTOSIface.h index f954e6d..3d78953 100644 --- a/src/RTOSIface/RTOSIface.h +++ b/src/RTOSIface/RTOSIface.h @@ -151,6 +151,9 @@ class TaskBase : public StaticTask_t void Resume() noexcept { vTaskResume(GetFreeRTOSHandle()); } void SetPriority(unsigned int priority) noexcept { vTaskPrioritySet(GetFreeRTOSHandle(), priority); } + + static void SetCurrentTaskPriority(unsigned int priority) noexcept { vTaskPrioritySet(nullptr, priority); } + bool IsRunning() const noexcept { return taskId != 0; } // Wake up a task identified by its handle from an ISR. Safe to call with a null handle.