Various improvements (#21)
* T-Deck stability and naming improvements * allow main task to clean itself up * remove unused includes * various lvgl improvements * added docs
This commit is contained in:
committed by
GitHub
parent
a2f0399c9f
commit
7a7b31e426
@@ -24,6 +24,9 @@
|
||||
#define THREAD_FLAGS_INVALID_BITS (~((1UL << MAX_BITS_TASK_NOTIFY) - 1U))
|
||||
#define EVENT_FLAGS_INVALID_BITS (~((1UL << MAX_BITS_EVENT_GROUPS) - 1U))
|
||||
|
||||
static_assert(ThreadPriorityHighest <= TT_CONFIG_THREAD_MAX_PRIORITIES, "highest thread priority is higher than max priority");
|
||||
static_assert(TT_CONFIG_THREAD_MAX_PRIORITIES <= configMAX_PRIORITIES, "highest tactility priority is higher than max FreeRTOS priority");
|
||||
|
||||
struct Thread {
|
||||
ThreadState state;
|
||||
int32_t ret;
|
||||
@@ -193,7 +196,7 @@ void tt_thread_set_context(Thread* thread, void* context) {
|
||||
void tt_thread_set_priority(Thread* thread, ThreadPriority priority) {
|
||||
tt_assert(thread);
|
||||
tt_assert(thread->state == ThreadStateStopped);
|
||||
tt_assert(priority >= ThreadPriorityIdle && priority <= ThreadPriorityIsr);
|
||||
tt_assert(priority >= 0 && priority <= TT_CONFIG_THREAD_MAX_PRIORITIES);
|
||||
thread->priority = priority;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,17 +19,21 @@ typedef enum {
|
||||
|
||||
/** ThreadPriority */
|
||||
typedef enum {
|
||||
ThreadPriorityNone = 0, /**< Uninitialized, choose system default */
|
||||
ThreadPriorityIdle = 1, /**< Idle priority */
|
||||
ThreadPriorityLowest = 2, /**< Lowest */
|
||||
ThreadPriorityLow = 3, /**< Low */
|
||||
ThreadPriorityNormal = 4, /**< Normal */
|
||||
ThreadPriorityHigh = 5, /**< High */
|
||||
ThreadPriorityHighest = 6, /**< Highest */
|
||||
ThreadPriorityIsr =
|
||||
(TT_CONFIG_THREAD_MAX_PRIORITIES - 1), /**< Deferred ISR (highest possible) */
|
||||
ThreadPriorityNone = 0, /**< Uninitialized, choose system default */
|
||||
ThreadPriorityIdle = 1,
|
||||
ThreadPriorityLowest = 2,
|
||||
ThreadPriorityLow = 3,
|
||||
ThreadPriorityNormal = 4,
|
||||
ThreadPriorityHigh = 5,
|
||||
ThreadPriorityHigher = 6,
|
||||
ThreadPriorityHighest = 7
|
||||
} ThreadPriority;
|
||||
|
||||
#define THREAD_PRIORITY_APP ThreadPriorityNormal
|
||||
#define THREAD_PRIORITY_SERVICE ThreadPriorityHigh
|
||||
#define THREAD_PRIORITY_RENDER ThreadPriorityHigher
|
||||
#define THREAD_PRIORITY_ISR (TT_CONFIG_THREAD_MAX_PRIORITIES - 1)
|
||||
|
||||
/** Thread anonymous structure */
|
||||
typedef struct Thread Thread;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user