aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/multiple/X/gdisp_lld.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-06-02 18:57:22 +1000
committerinmarket <andrewh@inmarket.com.au>2013-06-02 18:57:22 +1000
commit1c258a82738e145953fc9cf40c68dcce6db87d92 (patch)
treec151e882619714d696276ce29ef3388dce6e1866 /drivers/multiple/X/gdisp_lld.c
parentc2a4f9a5d616f5b18a965652d7492aacd377e5e2 (diff)
downloaduGFX-1c258a82738e145953fc9cf40c68dcce6db87d92.tar.gz
uGFX-1c258a82738e145953fc9cf40c68dcce6db87d92.tar.bz2
uGFX-1c258a82738e145953fc9cf40c68dcce6db87d92.zip
GOS updates
Diffstat (limited to 'drivers/multiple/X/gdisp_lld.c')
-rw-r--r--drivers/multiple/X/gdisp_lld.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/multiple/X/gdisp_lld.c b/drivers/multiple/X/gdisp_lld.c
index c431c30c..ee436993 100644
--- a/drivers/multiple/X/gdisp_lld.c
+++ b/drivers/multiple/X/gdisp_lld.c
@@ -117,8 +117,8 @@ static void ProcessEvent(void) {
/* this is the X11 thread which keeps track of all events */
#if GDISP_THREAD_CHIBIOS
- static DECLARESTACK(waXThread, 1024);
- static threadreturn_t ThreadX(void *arg) {
+ static DECLARE_THREAD_STACK(waXThread, 1024);
+ static DECLARE_THREAD_FUNCTION(ThreadX, arg) {
(void)arg;
while(1) {
@@ -159,12 +159,12 @@ bool_t gdisp_lld_init(void)
XSetWindowAttributes xa;
XTextProperty WindowTitle;
char * WindowTitleText;
- #if !GDISP_THREAD_CHIBIOS
+ #if GDISP_THREAD_CHIBIOS
+ gfxThreadHandle hth;
+ #else
pthread_attr_t thattr;
pthread_t thid;
- #endif
- #if !GDISP_THREAD_CHIBIOS
XInitThreads();
#endif
@@ -228,16 +228,21 @@ bool_t gdisp_lld_init(void)
ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask);
#if GDISP_THREAD_CHIBIOS
- if (!gfxCreateThread(waXThread, sizeof(waXThread), HIGH_PRIORITY, ThreadX, 0)) {
+ if (!(hth = gfxThreadCreate(waXThread, sizeof(waXThread), HIGH_PRIORITY, ThreadX, 0))) {
+ fprintf(stderr, "Cannot start X Thread\n");
+ XCloseDisplay(dis);
+ exit(0);
+ }
+ gfxThreadClose(hth);
#else
if (pthread_attr_init(&thattr)
|| pthread_attr_setdetachstate(&thattr, PTHREAD_CREATE_DETACHED)
|| pthread_create(&thid, &thattr, ThreadX, 0)) {
+ fprintf(stderr, "Cannot start X Thread\n");
+ XCloseDisplay(dis);
+ exit(0);
+ }
#endif
- fprintf(stderr, "Cannot start X Thread\n");
- XCloseDisplay(dis);
- exit(0);
- }
/* Initialise the GDISP structure to match */
GDISP.Orientation = GDISP_ROTATE_0;