diff options
author | Tectu <joel@unormal.org> | 2012-06-07 19:06:13 +0200 |
---|---|---|
committer | Tectu <joel@unormal.org> | 2012-06-07 19:06:13 +0200 |
commit | e42ed87364921b53853d7a7e4fa3e0fd32e23b9e (patch) | |
tree | 1d279e2a7867f1548b565de464b512194768e7b7 | |
parent | 8c95db3a79e54d4df145b7b1c14627ab7b60f98b (diff) | |
download | uGFX-e42ed87364921b53853d7a7e4fa3e0fd32e23b9e.tar.gz uGFX-e42ed87364921b53853d7a7e4fa3e0fd32e23b9e.tar.bz2 uGFX-e42ed87364921b53853d7a7e4fa3e0fd32e23b9e.zip |
fixes
-rw-r--r-- | gui.c | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -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; } |