From e42ed87364921b53853d7a7e4fa3e0fd32e23b9e Mon Sep 17 00:00:00 2001 From: Tectu Date: Thu, 7 Jun 2012 19:06:13 +0200 Subject: [PATCH] fixes --- gui.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/gui.c b/gui.c index ad4f3333..2b504482 100644 --- a/gui.c +++ b/gui.c @@ -18,20 +18,11 @@ static msg_t buttonThread(struct buttonStruct_t *a) { static msg_t TouchPadThread(void *arg) { (void)arg; - unsigned char buffer[10]; chRegSetThreadName("GUI"); while(TRUE) { - if(tpIRQ()) { - x = tpReadX(); - y = tpReadY(); - - lcdFillArea(10, 10, 80, 80, Black); - sprintf(buffer, "X: %d", x); - lcdDrawString(10, 10, buffer, White, Black); - sprintf(buffer, "Y: %d", y); - lcdDrawString(10, 25, buffer, White, Black); - } + x = tpReadX(); + y = tpReadY(); chThdSleepMilliseconds(10); } @@ -40,7 +31,7 @@ static msg_t TouchPadThread(void *arg) { void guiInit(void) { Thread *tp = NULL; - tp = chThdCreateFromHeap(NULL, THD_WA_SIZE(512), HIGHPRIO-1, TouchPadThread, NULL); + tp = chThdCreateFromHeap(NULL, THD_WA_SIZE(64), HIGHPRIO-1, TouchPadThread, NULL); } Thread *guiDrawButton(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, unsigned char *str, uint16_t fontColor, uint16_t buttonColor, uint8_t *state) { @@ -56,7 +47,7 @@ Thread *guiDrawButton(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, unsign buttonStruct->state = state; lcdDrawRectString(x0, y0, x1, y1, str, fontColor, buttonColor); - tp = chThdCreateFromHeap(NULL, THD_WA_SIZE(128), NORMALPRIO+1, buttonThread, buttonStruct); + tp = chThdCreateFromHeap(NULL, THD_WA_SIZE(64), NORMALPRIO+1, buttonThread, buttonStruct); return tp; }