fsfw/src/fsfw/osal/windows/winTaskHelpers.h

42 lines
844 B
C
Raw Normal View History

#include <map>
2022-02-02 10:29:30 +01:00
#include <thread>
2022-09-27 21:46:11 +02:00
#include "fsfw/tasks/TaskFactory.h"
#ifdef _WIN32
2023-01-26 15:30:23 +01:00
// Thanks, windows
// clang-format off
2023-01-26 13:40:44 +01:00
#include <windows.h>
2023-01-26 15:30:23 +01:00
#include <processthreadsapi.h>
// clang-format on
2022-09-27 21:46:11 +02:00
namespace tasks {
2022-02-02 10:29:30 +01:00
enum PriorityClass : uint16_t {
CLASS_IDLE,
CLASS_BELOW_NORMAL,
CLASS_NORMAL,
CLASS_ABOVE_NORMAL,
CLASS_HIGH,
CLASS_REALTIME
};
2022-02-02 10:29:30 +01:00
enum PriorityNumber : uint16_t {
IDLE,
LOWEST,
BELOW_NORMAL,
NORMAL,
ABOVE_NORMAL,
HIGHEST,
CRITICAL
};
TaskPriority makeWinPriority(PriorityClass prioClass = PriorityClass::CLASS_NORMAL,
2022-02-02 10:29:30 +01:00
PriorityNumber prioNumber = PriorityNumber::NORMAL);
void getWinPriorityParameters(TaskPriority priority, DWORD& priorityClass, int& priorityNumber);
ReturnValue_t setTaskPriority(HANDLE nativeHandle, TaskPriority priority);
2022-02-02 10:29:30 +01:00
} // namespace tasks
#endif