gThreadpriorityLow/Normal/High to replace LOW_/NORMAL_/HIGH_PRIORITY
This commit is contained in:
parent
93da5a0578
commit
1fc4180d41
30 changed files with 70 additions and 67 deletions
|
@ -19,7 +19,7 @@ CHANGE: Added type gBool to replace V2.x bool_t, and values gT
|
||||||
CHANGE: Added type gDelay to replace V2.x delaytime_t and values gDelayNone/gDelayForever to replace TIME_IMMEDIATE/TIME_INFINITE
|
CHANGE: Added type gDelay to replace V2.x delaytime_t and values gDelayNone/gDelayForever to replace TIME_IMMEDIATE/TIME_INFINITE
|
||||||
CHANGE: Added type gTicks to replace V2.x systemticks_t
|
CHANGE: Added type gTicks to replace V2.x systemticks_t
|
||||||
CHANGE: Added type gThreadreturn to replace V2.x threadreturn_t
|
CHANGE: Added type gThreadreturn to replace V2.x threadreturn_t
|
||||||
CHANGE: Added type gThreadpriority to replace V2.x threadpriority_t
|
CHANGE: Added type gThreadpriority to replace V2.x threadpriority_t and values gThreadpriorityLow/Normal/High to replace LOW_/NORMAL_/HIGH_PRIORITY
|
||||||
CHANGE: Added type gPoint to replace V2.x point and point_t
|
CHANGE: Added type gPoint to replace V2.x point and point_t
|
||||||
CHANGE: Added type gCoord to replace V2.x coord_t
|
CHANGE: Added type gCoord to replace V2.x coord_t
|
||||||
CHANGE: Added type gPixel to replace V2.x pixel_t
|
CHANGE: Added type gPixel to replace V2.x pixel_t
|
||||||
|
|
2
demos/3rdparty/notepad-2/notepadApp.h
vendored
2
demos/3rdparty/notepad-2/notepadApp.h
vendored
|
@ -38,7 +38,7 @@
|
||||||
#include "notepadCore.h"
|
#include "notepadCore.h"
|
||||||
#include "notepadUIDefines.h"
|
#include "notepadUIDefines.h"
|
||||||
|
|
||||||
#define NPAD_THD_PRIO NORMAL_PRIORITY
|
#define NPAD_THD_PRIO gThreadpriorityNormal
|
||||||
#define NPAD_THD_WA_SIZE 512
|
#define NPAD_THD_WA_SIZE 512
|
||||||
|
|
||||||
void nSetColorScheme(NColorScheme sch);
|
void nSetColorScheme(NColorScheme sch);
|
||||||
|
|
2
demos/3rdparty/notepad-2/notepadCore.h
vendored
2
demos/3rdparty/notepad-2/notepadCore.h
vendored
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
/* Configuration */
|
/* Configuration */
|
||||||
#define NCORE_THD_STACK_SIZE 256
|
#define NCORE_THD_STACK_SIZE 256
|
||||||
#define NCORE_THD_PRIO NORMAL_PRIORITY
|
#define NCORE_THD_PRIO gThreadpriorityNormal
|
||||||
|
|
||||||
#define NCORE_MODE_DRAW 0
|
#define NCORE_MODE_DRAW 0
|
||||||
#define NCORE_MODE_ERASE 1
|
#define NCORE_MODE_ERASE 1
|
||||||
|
|
|
@ -153,7 +153,7 @@ void doBounce(GHandle parent, gBool start) {
|
||||||
if (start) {
|
if (start) {
|
||||||
run = gTrue;
|
run = gTrue;
|
||||||
gh = parent;
|
gh = parent;
|
||||||
thread = gfxThreadCreate(0, 0x200, LOW_PRIORITY, task, 0);
|
thread = gfxThreadCreate(0, 0x200, gThreadpriorityLow, task, 0);
|
||||||
} else if (run) {
|
} else if (run) {
|
||||||
run = gFalse;
|
run = gFalse;
|
||||||
gfxThreadWait(thread);
|
gfxThreadWait(thread);
|
||||||
|
|
|
@ -89,7 +89,7 @@ void doMandlebrot(GHandle parent, gBool start) {
|
||||||
if (start) {
|
if (start) {
|
||||||
run = gTrue;
|
run = gTrue;
|
||||||
gh = parent;
|
gh = parent;
|
||||||
thread = gfxThreadCreate(0, 0x400, LOW_PRIORITY, task, 0);
|
thread = gfxThreadCreate(0, 0x400, gThreadpriorityLow, task, 0);
|
||||||
} else if (run) {
|
} else if (run) {
|
||||||
run = gFalse;
|
run = gFalse;
|
||||||
gfxThreadWait(thread);
|
gfxThreadWait(thread);
|
||||||
|
|
|
@ -460,7 +460,7 @@ void jg10Start(void) {
|
||||||
#endif
|
#endif
|
||||||
initField();
|
initField();
|
||||||
guiCreate();
|
guiCreate();
|
||||||
gfxThreadCreate(0, 1024, NORMAL_PRIORITY, thdJg10, 0);
|
gfxThreadCreate(0, 1024, gThreadpriorityNormal, thdJg10, 0);
|
||||||
while (!jg10GameOver) {
|
while (!jg10GameOver) {
|
||||||
gfxSleepMilliseconds(100);
|
gfxSleepMilliseconds(100);
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,7 +382,7 @@ void minesStart(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
initField();
|
initField();
|
||||||
gfxThreadCreate(0, 1024, NORMAL_PRIORITY, thdMines, 0);
|
gfxThreadCreate(0, 1024, gThreadpriorityNormal, thdMines, 0);
|
||||||
while (!minesGameOver) {
|
while (!minesGameOver) {
|
||||||
gfxSleepMilliseconds(100);
|
gfxSleepMilliseconds(100);
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,7 +498,7 @@ void tetrisStart(void) {
|
||||||
tetrisGameOver = gFalse;
|
tetrisGameOver = gFalse;
|
||||||
printGameOver(); // removes "Game Over!" if tetrisGameOver == gFalse
|
printGameOver(); // removes "Game Over!" if tetrisGameOver == gFalse
|
||||||
tetrisPreviousGameTime = gfxSystemTicks();
|
tetrisPreviousGameTime = gfxSystemTicks();
|
||||||
gfxThreadCreate(0, 1024, NORMAL_PRIORITY, thdTetris, 0);
|
gfxThreadCreate(0, 1024, gThreadpriorityNormal, thdTetris, 0);
|
||||||
while (!tetrisGameOver) {
|
while (!tetrisGameOver) {
|
||||||
gfxSleepMilliseconds(1000);
|
gfxSleepMilliseconds(1000);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,8 +51,8 @@ int main(void)
|
||||||
gfxInit();
|
gfxInit();
|
||||||
|
|
||||||
// Give this plenty of stack. Stack size optimisation should be a production change only
|
// Give this plenty of stack. Stack size optimisation should be a production change only
|
||||||
gfxThreadCreate(0, 2048, NORMAL_PRIORITY, heartbeat1, 0);
|
gfxThreadCreate(0, 2048, gThreadpriorityNormal, heartbeat1, 0);
|
||||||
gfxThreadCreate(0, 2048, NORMAL_PRIORITY, heartbeat2, 0);
|
gfxThreadCreate(0, 2048, gThreadpriorityNormal, heartbeat2, 0);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
DEBUGWRITE("thread main\n");
|
DEBUGWRITE("thread main\n");
|
||||||
|
|
|
@ -107,7 +107,7 @@ int main(void)
|
||||||
/* Create a static thread from the default heap with normal priority.
|
/* Create a static thread from the default heap with normal priority.
|
||||||
* We pass a the parameter to the thread which tells the thread whether to return or not
|
* We pass a the parameter to the thread which tells the thread whether to return or not
|
||||||
*/
|
*/
|
||||||
thd = gfxThreadCreate(NULL, 2048, NORMAL_PRIORITY, Thread_function, (void*)&exitThread);
|
thd = gfxThreadCreate(NULL, 2048, gThreadpriorityNormal, Thread_function, (void*)&exitThread);
|
||||||
|
|
||||||
/* Start the timer. The callback function will be called once after 2000ms
|
/* Start the timer. The callback function will be called once after 2000ms
|
||||||
* We will pass the thread handle as a parameter so the timer can ask the thread to terminate
|
* We will pass the thread handle as a parameter so the timer can ask the thread to terminate
|
||||||
|
|
|
@ -81,7 +81,7 @@
|
||||||
#define StartSockets() Start_LWIP();
|
#define StartSockets() Start_LWIP();
|
||||||
#else
|
#else
|
||||||
#include "lwipthread.h"
|
#include "lwipthread.h"
|
||||||
#define StartSockets() gfxThreadClose(gfxThreadCreate(wa_lwip_thread, LWIP_THREAD_STACK_SIZE, NORMAL_PRIORITY, lwip_thread, 0))
|
#define StartSockets() gfxThreadClose(gfxThreadCreate(wa_lwip_thread, LWIP_THREAD_STACK_SIZE, gThreadpriorityNormal, lwip_thread, 0))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !LWIP_SOCKET
|
#if !LWIP_SOCKET
|
||||||
|
@ -358,7 +358,7 @@ int main(proto_args) {
|
||||||
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
|
#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
|
||||||
// Start the mouse thread if needed
|
// Start the mouse thread if needed
|
||||||
if (cmd[3])
|
if (cmd[3])
|
||||||
gfxThreadClose(gfxThreadCreate(waNetThread, sizeof(waNetThread), HIGH_PRIORITY, NetThread, 0));
|
gfxThreadClose(gfxThreadCreate(waNetThread, sizeof(waNetThread), gThreadpriorityHigh, NetThread, 0));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Process incoming instructions
|
// Process incoming instructions
|
||||||
|
|
|
@ -330,7 +330,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
#endif
|
#endif
|
||||||
fprintf(stderr, "Running GFX Window in %d bit color\n", vis.depth);
|
fprintf(stderr, "Running GFX Window in %d bit color\n", vis.depth);
|
||||||
|
|
||||||
if (!(hth = gfxThreadCreate(waXThread, sizeof(waXThread), HIGH_PRIORITY, ThreadX, 0))) {
|
if (!(hth = gfxThreadCreate(waXThread, sizeof(waXThread), gThreadpriorityHigh, ThreadX, 0))) {
|
||||||
fprintf(stderr, "Cannot start X Thread\n");
|
fprintf(stderr, "Cannot start X Thread\n");
|
||||||
XCloseDisplay(dis);
|
XCloseDisplay(dis);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
|
@ -124,7 +124,7 @@
|
||||||
#define StartSockets() Start_LWIP();
|
#define StartSockets() Start_LWIP();
|
||||||
#else
|
#else
|
||||||
#include "lwipthread.h"
|
#include "lwipthread.h"
|
||||||
#define StartSockets() gfxThreadClose(gfxThreadCreate(wa_lwip_thread, LWIP_THREAD_STACK_SIZE, NORMAL_PRIORITY, lwip_thread, 0))
|
#define StartSockets() gfxThreadClose(gfxThreadCreate(wa_lwip_thread, LWIP_THREAD_STACK_SIZE, gThreadpriorityNormal, lwip_thread, 0))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !LWIP_SOCKET
|
#if !LWIP_SOCKET
|
||||||
|
@ -435,7 +435,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
|
||||||
// Initialise the receiver thread (if it hasn't been done already)
|
// Initialise the receiver thread (if it hasn't been done already)
|
||||||
if (!hThread) {
|
if (!hThread) {
|
||||||
MUTEX_INIT;
|
MUTEX_INIT;
|
||||||
hThread = gfxThreadCreate(waNetThread, sizeof(waNetThread), HIGH_PRIORITY, NetThread, 0);
|
hThread = gfxThreadCreate(waNetThread, sizeof(waNetThread), gThreadpriorityHigh, NetThread, 0);
|
||||||
gfxThreadClose(hThread);
|
gfxThreadClose(hThread);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -264,7 +264,7 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
//#define GFX_USE_GTIMER GFXOFF
|
//#define GFX_USE_GTIMER GFXOFF
|
||||||
|
|
||||||
//#define GTIMER_THREAD_PRIORITY HIGH_PRIORITY
|
//#define GTIMER_THREAD_PRIORITY gThreadpriorityHigh
|
||||||
//#define GTIMER_THREAD_WORKAREA_SIZE 2048
|
//#define GTIMER_THREAD_WORKAREA_SIZE 2048
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -102,9 +102,9 @@
|
||||||
#define gDelayNone 0
|
#define gDelayNone 0
|
||||||
#define gDelayForever ((gDelay)-1)
|
#define gDelayForever ((gDelay)-1)
|
||||||
#define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
|
#define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
|
||||||
#define LOW_PRIORITY 0
|
#define gThreadpriorityLow 0
|
||||||
#define NORMAL_PRIORITY 1
|
#define gThreadpriorityNormal 1
|
||||||
#define HIGH_PRIORITY 2
|
#define gThreadpriorityHigh 2
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -495,14 +495,17 @@
|
||||||
|
|
||||||
#if GFX_COMPAT_V2
|
#if GFX_COMPAT_V2
|
||||||
typedef gDelay delaytime_t;
|
typedef gDelay delaytime_t;
|
||||||
typedef gTicks systemticks_t;
|
|
||||||
typedef gThreadreturn threadreturn_t;
|
|
||||||
typedef gThreadpriority threadpriority_t;
|
|
||||||
#if !GFX_USE_OS_CHIBIOS
|
#if !GFX_USE_OS_CHIBIOS
|
||||||
// These are defined by ChibiOS itself
|
// These values are defined by ChibiOS itself
|
||||||
#define TIME_IMMEDIATE gDelayNone
|
#define TIME_IMMEDIATE gDelayNone
|
||||||
#define TIME_INFINITE gDelayForever
|
#define TIME_INFINITE gDelayForever
|
||||||
#endif
|
#endif
|
||||||
|
typedef gTicks systemticks_t;
|
||||||
|
typedef gThreadreturn threadreturn_t;
|
||||||
|
typedef gThreadpriority threadpriority_t;
|
||||||
|
#define LOW_PRIORITY gThreadpriorityLow
|
||||||
|
#define NORMAL_PRIORITY gThreadpriorityNormal
|
||||||
|
#define HIGH_PRIORITY gThreadpriorityHigh
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _GOS_H */
|
#endif /* _GOS_H */
|
||||||
|
|
|
@ -39,9 +39,9 @@ typedef msg_t gThreadreturn;
|
||||||
typedef tprio_t gThreadpriority;
|
typedef tprio_t gThreadpriority;
|
||||||
|
|
||||||
#define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
|
#define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
|
||||||
#define LOW_PRIORITY LOWPRIO
|
#define gThreadpriorityLow LOWPRIO
|
||||||
#define NORMAL_PRIORITY NORMALPRIO
|
#define gThreadpriorityNormal NORMALPRIO
|
||||||
#define HIGH_PRIORITY HIGHPRIO
|
#define gThreadpriorityHigh HIGHPRIO
|
||||||
|
|
||||||
#define DECLARE_THREAD_STACK(name, sz) WORKING_AREA(name, sz)
|
#define DECLARE_THREAD_STACK(name, sz) WORKING_AREA(name, sz)
|
||||||
#define DECLARE_THREAD_FUNCTION(fnName, param) gThreadreturn fnName(void *param)
|
#define DECLARE_THREAD_FUNCTION(fnName, param) gThreadreturn fnName(void *param)
|
||||||
|
|
|
@ -34,9 +34,9 @@ typedef void gThreadreturn;
|
||||||
typedef osPriority gThreadpriority;
|
typedef osPriority gThreadpriority;
|
||||||
|
|
||||||
#define MAX_SEMAPHORE_COUNT osFeature_Semaphore
|
#define MAX_SEMAPHORE_COUNT osFeature_Semaphore
|
||||||
#define LOW_PRIORITY osPriorityLow
|
#define gThreadpriorityLow osPriorityLow
|
||||||
#define NORMAL_PRIORITY osPriorityNormal
|
#define gThreadpriorityNormal osPriorityNormal
|
||||||
#define HIGH_PRIORITY osPriorityHigh
|
#define gThreadpriorityHigh osPriorityHigh
|
||||||
|
|
||||||
typedef struct gfxSem {
|
typedef struct gfxSem {
|
||||||
uint32_t semaphore[2];
|
uint32_t semaphore[2];
|
||||||
|
|
|
@ -44,12 +44,12 @@ void _gosPostInit(void)
|
||||||
osKernelInitialize();
|
osKernelInitialize();
|
||||||
/* Fall Through */
|
/* Fall Through */
|
||||||
case osKernelReady:
|
case osKernelReady:
|
||||||
gfxThreadCreate(0, GFX_OS_UGFXMAIN_STACKSIZE, NORMAL_PRIORITY, startUGFX_CMSIS2, 0);
|
gfxThreadCreate(0, GFX_OS_UGFXMAIN_STACKSIZE, gThreadpriorityNormal, startUGFX_CMSIS2, 0);
|
||||||
osKernelStart();
|
osKernelStart();
|
||||||
gfxHalt("Unable to start CMSIS V2 scheduler. Out of memory?");
|
gfxHalt("Unable to start CMSIS V2 scheduler. Out of memory?");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
gfxThreadCreate(0, GFX_OS_UGFXMAIN_STACKSIZE, NORMAL_PRIORITY, startUGFX_CMSIS2, 0);
|
gfxThreadCreate(0, GFX_OS_UGFXMAIN_STACKSIZE, gThreadpriorityNormal, startUGFX_CMSIS2, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -34,9 +34,9 @@ typedef void gThreadreturn;
|
||||||
typedef osPriority_t gThreadpriority;
|
typedef osPriority_t gThreadpriority;
|
||||||
|
|
||||||
#define MAX_SEMAPHORE_COUNT 65535UL
|
#define MAX_SEMAPHORE_COUNT 65535UL
|
||||||
#define LOW_PRIORITY osPriorityLow
|
#define gThreadpriorityLow osPriorityLow
|
||||||
#define NORMAL_PRIORITY osPriorityNormal
|
#define gThreadpriorityNormal osPriorityNormal
|
||||||
#define HIGH_PRIORITY osPriorityHigh
|
#define gThreadpriorityHigh osPriorityHigh
|
||||||
|
|
||||||
typedef osSemaphoreId_t gfxSem;
|
typedef osSemaphoreId_t gfxSem;
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,9 @@ typedef cyg_addrword_t gThreadpriority;
|
||||||
typedef cyg_handle_t gfxThreadHandle;
|
typedef cyg_handle_t gfxThreadHandle;
|
||||||
|
|
||||||
#define MAX_SEMAPHORE_COUNT 0x7FFFFFFF
|
#define MAX_SEMAPHORE_COUNT 0x7FFFFFFF
|
||||||
#define LOW_PRIORITY (CYGNUM_KERNEL_SCHED_PRIORITIES-2)
|
#define gThreadpriorityLow (CYGNUM_KERNEL_SCHED_PRIORITIES-2)
|
||||||
#define NORMAL_PRIORITY (CYGNUM_KERNEL_SCHED_PRIORITIES/2)
|
#define gThreadpriorityNormal (CYGNUM_KERNEL_SCHED_PRIORITIES/2)
|
||||||
#define HIGH_PRIORITY 0
|
#define gThreadpriorityHigh 0
|
||||||
|
|
||||||
#define DECLARE_THREAD_STACK(name, sz) struct { cyg_thread t; unsigned char stk[(sz) & ~3]; } name[1]
|
#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)
|
#define DECLARE_THREAD_FUNCTION(fnName, param) gThreadreturn fnName(cyg_addrword_t param)
|
||||||
|
|
|
@ -52,7 +52,7 @@ void _gosPostInit(void)
|
||||||
{
|
{
|
||||||
#if !GFX_OS_NO_INIT && GFX_OS_CALL_UGFXMAIN
|
#if !GFX_OS_NO_INIT && GFX_OS_CALL_UGFXMAIN
|
||||||
if (xTaskGetSchedulerState() == taskSCHEDULER_NOT_STARTED) {
|
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();
|
vTaskStartScheduler();
|
||||||
gfxHalt("Unable to start FreeRTOS scheduler. Out of memory?");
|
gfxHalt("Unable to start FreeRTOS scheduler. Out of memory?");
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,9 +33,9 @@ typedef void gThreadreturn;
|
||||||
typedef portBASE_TYPE gThreadpriority;
|
typedef portBASE_TYPE gThreadpriority;
|
||||||
|
|
||||||
#define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
|
#define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
|
||||||
#define LOW_PRIORITY 0
|
#define gThreadpriorityLow 0
|
||||||
#define NORMAL_PRIORITY configMAX_PRIORITIES/2
|
#define gThreadpriorityNormal configMAX_PRIORITIES/2
|
||||||
#define HIGH_PRIORITY configMAX_PRIORITIES-1
|
#define gThreadpriorityHigh configMAX_PRIORITIES-1
|
||||||
|
|
||||||
/* FreeRTOS will allocate the stack when creating the thread */
|
/* FreeRTOS will allocate the stack when creating the thread */
|
||||||
#define DECLARE_THREAD_STACK(name, sz) uint8_t name[1]
|
#define DECLARE_THREAD_STACK(name, sz) uint8_t name[1]
|
||||||
|
|
|
@ -52,9 +52,9 @@ typedef pthread_mutex_t gfxMutex;
|
||||||
#define gDelayNone 0
|
#define gDelayNone 0
|
||||||
#define gDelayForever ((gDelay)-1)
|
#define gDelayForever ((gDelay)-1)
|
||||||
#define MAX_SEMAPHORE_COUNT ((gSemcount)-1)
|
#define MAX_SEMAPHORE_COUNT ((gSemcount)-1)
|
||||||
#define LOW_PRIORITY 10
|
#define gThreadpriorityLow 10
|
||||||
#define NORMAL_PRIORITY 0
|
#define gThreadpriorityNormal 0
|
||||||
#define HIGH_PRIORITY -10
|
#define gThreadpriorityHigh -10
|
||||||
|
|
||||||
#if GFX_USE_POSIX_SEMAPHORES
|
#if GFX_USE_POSIX_SEMAPHORES
|
||||||
typedef struct gfxSem {
|
typedef struct gfxSem {
|
||||||
|
|
|
@ -44,9 +44,9 @@ typedef pthread_mutex_t gfxMutex;
|
||||||
#define gDelayNone 0
|
#define gDelayNone 0
|
||||||
#define gDelayForever ((gDelay)-1)
|
#define gDelayForever ((gDelay)-1)
|
||||||
#define MAX_SEMAPHORE_COUNT ((gSemcount)-1)
|
#define MAX_SEMAPHORE_COUNT ((gSemcount)-1)
|
||||||
#define LOW_PRIORITY 10
|
#define gThreadpriorityLow 10
|
||||||
#define NORMAL_PRIORITY 0
|
#define gThreadpriorityNormal 0
|
||||||
#define HIGH_PRIORITY -10
|
#define gThreadpriorityHigh -10
|
||||||
|
|
||||||
typedef struct gfxSem {
|
typedef struct gfxSem {
|
||||||
pthread_mutex_t mtx;
|
pthread_mutex_t mtx;
|
||||||
|
|
|
@ -17,9 +17,9 @@
|
||||||
#define gDelayNone 0
|
#define gDelayNone 0
|
||||||
#define gDelayForever ((gDelay)-1)
|
#define gDelayForever ((gDelay)-1)
|
||||||
#define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
|
#define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
|
||||||
#define LOW_PRIORITY 2
|
#define gThreadpriorityLow 2
|
||||||
#define NORMAL_PRIORITY 3
|
#define gThreadpriorityNormal 3
|
||||||
#define HIGH_PRIORITY 4
|
#define gThreadpriorityHigh 4
|
||||||
|
|
||||||
typedef int gTicks;
|
typedef int gTicks;
|
||||||
typedef int gDelay;
|
typedef int gDelay;
|
||||||
|
|
|
@ -14,9 +14,9 @@ typedef uint32_t gThreadreturn;
|
||||||
typedef RAW_U8 gThreadpriority;
|
typedef RAW_U8 gThreadpriority;
|
||||||
|
|
||||||
#define MAX_SEMAPHORE_COUNT RAW_SEMAPHORE_COUNT
|
#define MAX_SEMAPHORE_COUNT RAW_SEMAPHORE_COUNT
|
||||||
#define LOW_PRIORITY (CONFIG_RAW_PRIO_MAX-2)
|
#define gThreadpriorityLow (CONFIG_RAW_PRIO_MAX-2)
|
||||||
#define NORMAL_PRIORITY (CONFIG_RAW_PRIO_MAX/2)
|
#define gThreadpriorityNormal (CONFIG_RAW_PRIO_MAX/2)
|
||||||
#define HIGH_PRIORITY 1
|
#define gThreadpriorityHigh 1
|
||||||
|
|
||||||
typedef RAW_SEMAPHORE gfxSem;
|
typedef RAW_SEMAPHORE gfxSem;
|
||||||
typedef RAW_MUTEX gfxMutex;
|
typedef RAW_MUTEX gfxMutex;
|
||||||
|
|
|
@ -38,9 +38,9 @@ typedef int gThreadpriority;
|
||||||
#define gDelayNone 0
|
#define gDelayNone 0
|
||||||
#define gDelayForever INFINITE
|
#define gDelayForever INFINITE
|
||||||
#define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
|
#define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
|
||||||
#define LOW_PRIORITY THREAD_PRIORITY_BELOW_NORMAL
|
#define gThreadpriorityLow THREAD_PRIORITY_BELOW_NORMAL
|
||||||
#define NORMAL_PRIORITY THREAD_PRIORITY_NORMAL
|
#define gThreadpriorityNormal THREAD_PRIORITY_NORMAL
|
||||||
#define HIGH_PRIORITY THREAD_PRIORITY_ABOVE_NORMAL
|
#define gThreadpriorityHigh THREAD_PRIORITY_ABOVE_NORMAL
|
||||||
|
|
||||||
typedef HANDLE gfxSem;
|
typedef HANDLE gfxSem;
|
||||||
typedef HANDLE gfxMutex;
|
typedef HANDLE gfxMutex;
|
||||||
|
|
|
@ -37,9 +37,9 @@ typedef int gThreadpriority;
|
||||||
#define gDelayNone 0
|
#define gDelayNone 0
|
||||||
#define gDelayForever ((gDelay)-1)
|
#define gDelayForever ((gDelay)-1)
|
||||||
#define MAX_SEMAPHORE_COUNT 0x7FFF
|
#define MAX_SEMAPHORE_COUNT 0x7FFF
|
||||||
#define LOW_PRIORITY 0
|
#define gThreadpriorityLow 0
|
||||||
#define NORMAL_PRIORITY 1
|
#define gThreadpriorityNormal 1
|
||||||
#define HIGH_PRIORITY 2
|
#define gThreadpriorityHigh 2
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
gSemcount cnt;
|
gSemcount cnt;
|
||||||
|
|
|
@ -33,9 +33,9 @@ typedef int gThreadpriority;
|
||||||
#define gDelayNone K_NO_WAIT
|
#define gDelayNone K_NO_WAIT
|
||||||
#define gDelayForever K_FOREVER
|
#define gDelayForever K_FOREVER
|
||||||
#define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
|
#define MAX_SEMAPHORE_COUNT ((gSemcount)(((unsigned long)((gSemcount)(-1))) >> 1))
|
||||||
#define LOW_PRIORITY CONFIG_NUM_PREEMPT_PRIORITIES-1
|
#define gThreadpriorityLow CONFIG_NUM_PREEMPT_PRIORITIES-1
|
||||||
#define NORMAL_PRIORITY 1
|
#define gThreadpriorityNormal 1
|
||||||
#define HIGH_PRIORITY 0
|
#define gThreadpriorityHigh 0
|
||||||
|
|
||||||
typedef struct k_sem gfxSem;
|
typedef struct k_sem gfxSem;
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,10 @@
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @brief Defines the GTIMER thread priority
|
* @brief Defines the GTIMER thread priority
|
||||||
* @details Defaults to HIGH_PRIORITY
|
* @details Defaults to gThreadpriorityHigh
|
||||||
*/
|
*/
|
||||||
#ifndef GTIMER_THREAD_PRIORITY
|
#ifndef GTIMER_THREAD_PRIORITY
|
||||||
#define GTIMER_THREAD_PRIORITY HIGH_PRIORITY
|
#define GTIMER_THREAD_PRIORITY gThreadpriorityHigh
|
||||||
#endif
|
#endif
|
||||||
/**
|
/**
|
||||||
* @brief Defines the size of the timer threads work area (stack+structures).
|
* @brief Defines the size of the timer threads work area (stack+structures).
|
||||||
|
|
Loading…
Add table
Reference in a new issue