From 1fc4180d41a77088bbb2c0ce020d5ff7ab88c16e Mon Sep 17 00:00:00 2001 From: inmarket Date: Sun, 8 Jul 2018 15:32:26 +1000 Subject: gThreadpriorityLow/Normal/High to replace LOW_/NORMAL_/HIGH_PRIORITY --- src/gos/gos.h | 21 ++++++++++++--------- src/gos/gos_chibios.h | 6 +++--- src/gos/gos_cmsis.h | 6 +++--- src/gos/gos_cmsis2.c | 4 ++-- src/gos/gos_cmsis2.h | 6 +++--- src/gos/gos_ecos.h | 6 +++--- src/gos/gos_freertos.c | 2 +- src/gos/gos_freertos.h | 6 +++--- src/gos/gos_linux.h | 6 +++--- src/gos/gos_osx.h | 6 +++--- src/gos/gos_qt.h | 6 +++--- src/gos/gos_rawrtos.h | 6 +++--- src/gos/gos_win32.h | 6 +++--- src/gos/gos_x_threads.h | 6 +++--- src/gos/gos_zephyr.h | 6 +++--- src/gtimer/gtimer_options.h | 4 ++-- 16 files changed, 53 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/gos/gos.h b/src/gos/gos.h index e8684d6f..67ef0ddd 100644 --- a/src/gos/gos.h +++ b/src/gos/gos.h @@ -99,12 +99,12 @@ * @note Your platform may use slightly different definitions to these * @{ */ - #define gDelayNone 0 + #define gDelayNone 0 #define gDelayForever ((gDelay)-1) #define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1)) - #define LOW_PRIORITY 0 - #define NORMAL_PRIORITY 1 - #define HIGH_PRIORITY 2 + #define gThreadpriorityLow 0 + #define gThreadpriorityNormal 1 + #define gThreadpriorityHigh 2 /** @} */ /** @@ -495,14 +495,17 @@ #if GFX_COMPAT_V2 typedef gDelay delaytime_t; + #if !GFX_USE_OS_CHIBIOS + // These values are defined by ChibiOS itself + #define TIME_IMMEDIATE gDelayNone + #define TIME_INFINITE gDelayForever + #endif typedef gTicks systemticks_t; typedef gThreadreturn threadreturn_t; typedef gThreadpriority threadpriority_t; - #if !GFX_USE_OS_CHIBIOS - // These are defined by ChibiOS itself - #define TIME_IMMEDIATE gDelayNone - #define TIME_INFINITE gDelayForever - #endif + #define LOW_PRIORITY gThreadpriorityLow + #define NORMAL_PRIORITY gThreadpriorityNormal + #define HIGH_PRIORITY gThreadpriorityHigh #endif #endif /* _GOS_H */ diff --git a/src/gos/gos_chibios.h b/src/gos/gos_chibios.h index 450603c7..f9a85a88 100644 --- a/src/gos/gos_chibios.h +++ b/src/gos/gos_chibios.h @@ -39,9 +39,9 @@ typedef msg_t gThreadreturn; typedef tprio_t gThreadpriority; #define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1)) -#define LOW_PRIORITY LOWPRIO -#define NORMAL_PRIORITY NORMALPRIO -#define HIGH_PRIORITY HIGHPRIO +#define gThreadpriorityLow LOWPRIO +#define gThreadpriorityNormal NORMALPRIO +#define gThreadpriorityHigh HIGHPRIO #define DECLARE_THREAD_STACK(name, sz) WORKING_AREA(name, sz) #define DECLARE_THREAD_FUNCTION(fnName, param) gThreadreturn fnName(void *param) diff --git a/src/gos/gos_cmsis.h b/src/gos/gos_cmsis.h index 0f2d66f5..a5d9c474 100644 --- a/src/gos/gos_cmsis.h +++ b/src/gos/gos_cmsis.h @@ -34,9 +34,9 @@ typedef void gThreadreturn; typedef osPriority gThreadpriority; #define MAX_SEMAPHORE_COUNT osFeature_Semaphore -#define LOW_PRIORITY osPriorityLow -#define NORMAL_PRIORITY osPriorityNormal -#define HIGH_PRIORITY osPriorityHigh +#define gThreadpriorityLow osPriorityLow +#define gThreadpriorityNormal osPriorityNormal +#define gThreadpriorityHigh osPriorityHigh typedef struct gfxSem { uint32_t semaphore[2]; diff --git a/src/gos/gos_cmsis2.c b/src/gos/gos_cmsis2.c index 31c79164..affc7a37 100644 --- a/src/gos/gos_cmsis2.c +++ b/src/gos/gos_cmsis2.c @@ -44,12 +44,12 @@ void _gosPostInit(void) osKernelInitialize(); /* Fall Through */ case osKernelReady: - gfxThreadCreate(0, GFX_OS_UGFXMAIN_STACKSIZE, NORMAL_PRIORITY, startUGFX_CMSIS2, 0); + gfxThreadCreate(0, GFX_OS_UGFXMAIN_STACKSIZE, gThreadpriorityNormal, startUGFX_CMSIS2, 0); osKernelStart(); gfxHalt("Unable to start CMSIS V2 scheduler. Out of memory?"); break; default: - gfxThreadCreate(0, GFX_OS_UGFXMAIN_STACKSIZE, NORMAL_PRIORITY, startUGFX_CMSIS2, 0); + gfxThreadCreate(0, GFX_OS_UGFXMAIN_STACKSIZE, gThreadpriorityNormal, startUGFX_CMSIS2, 0); break; } #endif diff --git a/src/gos/gos_cmsis2.h b/src/gos/gos_cmsis2.h index 49c6cee2..7ff69cff 100644 --- a/src/gos/gos_cmsis2.h +++ b/src/gos/gos_cmsis2.h @@ -34,9 +34,9 @@ typedef void gThreadreturn; typedef osPriority_t gThreadpriority; #define MAX_SEMAPHORE_COUNT 65535UL -#define LOW_PRIORITY osPriorityLow -#define NORMAL_PRIORITY osPriorityNormal -#define HIGH_PRIORITY osPriorityHigh +#define gThreadpriorityLow osPriorityLow +#define gThreadpriorityNormal osPriorityNormal +#define gThreadpriorityHigh osPriorityHigh typedef osSemaphoreId_t gfxSem; diff --git a/src/gos/gos_ecos.h b/src/gos/gos_ecos.h index c7f4f1df..1ab7d42c 100644 --- a/src/gos/gos_ecos.h +++ b/src/gos/gos_ecos.h @@ -29,9 +29,9 @@ typedef cyg_addrword_t gThreadpriority; typedef cyg_handle_t gfxThreadHandle; #define MAX_SEMAPHORE_COUNT 0x7FFFFFFF -#define LOW_PRIORITY (CYGNUM_KERNEL_SCHED_PRIORITIES-2) -#define NORMAL_PRIORITY (CYGNUM_KERNEL_SCHED_PRIORITIES/2) -#define HIGH_PRIORITY 0 +#define gThreadpriorityLow (CYGNUM_KERNEL_SCHED_PRIORITIES-2) +#define gThreadpriorityNormal (CYGNUM_KERNEL_SCHED_PRIORITIES/2) +#define gThreadpriorityHigh 0 #define DECLARE_THREAD_STACK(name, sz) struct { cyg_thread t; unsigned char stk[(sz) & ~3]; } name[1] #define DECLARE_THREAD_FUNCTION(fnName, param) gThreadreturn fnName(cyg_addrword_t param) diff --git a/src/gos/gos_freertos.c b/src/gos/gos_freertos.c index d4aa0462..7152997f 100644 --- a/src/gos/gos_freertos.c +++ b/src/gos/gos_freertos.c @@ -52,7 +52,7 @@ void _gosPostInit(void) { #if !GFX_OS_NO_INIT && GFX_OS_CALL_UGFXMAIN if (xTaskGetSchedulerState() == taskSCHEDULER_NOT_STARTED) { - gfxThreadCreate(0, GFX_OS_UGFXMAIN_STACKSIZE, NORMAL_PRIORITY, startUGFX_FreeRTOS, 0); + gfxThreadCreate(0, GFX_OS_UGFXMAIN_STACKSIZE, gThreadpriorityNormal, startUGFX_FreeRTOS, 0); vTaskStartScheduler(); gfxHalt("Unable to start FreeRTOS scheduler. Out of memory?"); } diff --git a/src/gos/gos_freertos.h b/src/gos/gos_freertos.h index b65efdac..90c5af4c 100644 --- a/src/gos/gos_freertos.h +++ b/src/gos/gos_freertos.h @@ -33,9 +33,9 @@ typedef void gThreadreturn; typedef portBASE_TYPE gThreadpriority; #define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1)) -#define LOW_PRIORITY 0 -#define NORMAL_PRIORITY configMAX_PRIORITIES/2 -#define HIGH_PRIORITY configMAX_PRIORITIES-1 +#define gThreadpriorityLow 0 +#define gThreadpriorityNormal configMAX_PRIORITIES/2 +#define gThreadpriorityHigh configMAX_PRIORITIES-1 /* FreeRTOS will allocate the stack when creating the thread */ #define DECLARE_THREAD_STACK(name, sz) uint8_t name[1] diff --git a/src/gos/gos_linux.h b/src/gos/gos_linux.h index 1e7ff392..a2a09262 100644 --- a/src/gos/gos_linux.h +++ b/src/gos/gos_linux.h @@ -52,9 +52,9 @@ typedef pthread_mutex_t gfxMutex; #define gDelayNone 0 #define gDelayForever ((gDelay)-1) #define MAX_SEMAPHORE_COUNT ((gSemcount)-1) -#define LOW_PRIORITY 10 -#define NORMAL_PRIORITY 0 -#define HIGH_PRIORITY -10 +#define gThreadpriorityLow 10 +#define gThreadpriorityNormal 0 +#define gThreadpriorityHigh -10 #if GFX_USE_POSIX_SEMAPHORES typedef struct gfxSem { diff --git a/src/gos/gos_osx.h b/src/gos/gos_osx.h index 3f693258..5dcc63f3 100644 --- a/src/gos/gos_osx.h +++ b/src/gos/gos_osx.h @@ -44,9 +44,9 @@ typedef pthread_mutex_t gfxMutex; #define gDelayNone 0 #define gDelayForever ((gDelay)-1) #define MAX_SEMAPHORE_COUNT ((gSemcount)-1) -#define LOW_PRIORITY 10 -#define NORMAL_PRIORITY 0 -#define HIGH_PRIORITY -10 +#define gThreadpriorityLow 10 +#define gThreadpriorityNormal 0 +#define gThreadpriorityHigh -10 typedef struct gfxSem { pthread_mutex_t mtx; diff --git a/src/gos/gos_qt.h b/src/gos/gos_qt.h index cd2dbbb4..5338808e 100644 --- a/src/gos/gos_qt.h +++ b/src/gos/gos_qt.h @@ -17,9 +17,9 @@ #define gDelayNone 0 #define gDelayForever ((gDelay)-1) #define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1)) -#define LOW_PRIORITY 2 -#define NORMAL_PRIORITY 3 -#define HIGH_PRIORITY 4 +#define gThreadpriorityLow 2 +#define gThreadpriorityNormal 3 +#define gThreadpriorityHigh 4 typedef int gTicks; typedef int gDelay; diff --git a/src/gos/gos_rawrtos.h b/src/gos/gos_rawrtos.h index 1fb20f90..c04a543b 100644 --- a/src/gos/gos_rawrtos.h +++ b/src/gos/gos_rawrtos.h @@ -14,9 +14,9 @@ typedef uint32_t gThreadreturn; typedef RAW_U8 gThreadpriority; #define MAX_SEMAPHORE_COUNT RAW_SEMAPHORE_COUNT -#define LOW_PRIORITY (CONFIG_RAW_PRIO_MAX-2) -#define NORMAL_PRIORITY (CONFIG_RAW_PRIO_MAX/2) -#define HIGH_PRIORITY 1 +#define gThreadpriorityLow (CONFIG_RAW_PRIO_MAX-2) +#define gThreadpriorityNormal (CONFIG_RAW_PRIO_MAX/2) +#define gThreadpriorityHigh 1 typedef RAW_SEMAPHORE gfxSem; typedef RAW_MUTEX gfxMutex; diff --git a/src/gos/gos_win32.h b/src/gos/gos_win32.h index c4033f5c..ce2a4c10 100644 --- a/src/gos/gos_win32.h +++ b/src/gos/gos_win32.h @@ -38,9 +38,9 @@ typedef int gThreadpriority; #define gDelayNone 0 #define gDelayForever INFINITE #define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1)) -#define LOW_PRIORITY THREAD_PRIORITY_BELOW_NORMAL -#define NORMAL_PRIORITY THREAD_PRIORITY_NORMAL -#define HIGH_PRIORITY THREAD_PRIORITY_ABOVE_NORMAL +#define gThreadpriorityLow THREAD_PRIORITY_BELOW_NORMAL +#define gThreadpriorityNormal THREAD_PRIORITY_NORMAL +#define gThreadpriorityHigh THREAD_PRIORITY_ABOVE_NORMAL typedef HANDLE gfxSem; typedef HANDLE gfxMutex; diff --git a/src/gos/gos_x_threads.h b/src/gos/gos_x_threads.h index a1ba67a1..7b7509c4 100644 --- a/src/gos/gos_x_threads.h +++ b/src/gos/gos_x_threads.h @@ -37,9 +37,9 @@ typedef int gThreadpriority; #define gDelayNone 0 #define gDelayForever ((gDelay)-1) #define MAX_SEMAPHORE_COUNT 0x7FFF -#define LOW_PRIORITY 0 -#define NORMAL_PRIORITY 1 -#define HIGH_PRIORITY 2 +#define gThreadpriorityLow 0 +#define gThreadpriorityNormal 1 +#define gThreadpriorityHigh 2 typedef struct { gSemcount cnt; diff --git a/src/gos/gos_zephyr.h b/src/gos/gos_zephyr.h index 662a0c82..ce57e131 100644 --- a/src/gos/gos_zephyr.h +++ b/src/gos/gos_zephyr.h @@ -33,9 +33,9 @@ typedef int gThreadpriority; #define gDelayNone K_NO_WAIT #define gDelayForever K_FOREVER #define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1)) -#define LOW_PRIORITY CONFIG_NUM_PREEMPT_PRIORITIES-1 -#define NORMAL_PRIORITY 1 -#define HIGH_PRIORITY 0 +#define gThreadpriorityLow CONFIG_NUM_PREEMPT_PRIORITIES-1 +#define gThreadpriorityNormal 1 +#define gThreadpriorityHigh 0 typedef struct k_sem gfxSem; diff --git a/src/gtimer/gtimer_options.h b/src/gtimer/gtimer_options.h index dc0c6141..d3fd5f0d 100644 --- a/src/gtimer/gtimer_options.h +++ b/src/gtimer/gtimer_options.h @@ -28,10 +28,10 @@ */ /** * @brief Defines the GTIMER thread priority - * @details Defaults to HIGH_PRIORITY + * @details Defaults to gThreadpriorityHigh */ #ifndef GTIMER_THREAD_PRIORITY - #define GTIMER_THREAD_PRIORITY HIGH_PRIORITY + #define GTIMER_THREAD_PRIORITY gThreadpriorityHigh #endif /** * @brief Defines the size of the timer threads work area (stack+structures). -- cgit v1.2.3