diff options
author | Tectu <joel@unormal.org> | 2012-06-09 16:22:08 +0200 |
---|---|---|
committer | Tectu <joel@unormal.org> | 2012-06-09 16:22:08 +0200 |
commit | 4cccbb1711b73d8f6ca9fe8ae914127c708cbdfc (patch) | |
tree | 92c987203ec7585fda16d57f4054afa404d23037 /gui.c | |
parent | e78a6130786c7d803278483a6579cdd0d40c37b1 (diff) | |
download | uGFX-4cccbb1711b73d8f6ca9fe8ae914127c708cbdfc.tar.gz uGFX-4cccbb1711b73d8f6ca9fe8ae914127c708cbdfc.tar.bz2 uGFX-4cccbb1711b73d8f6ca9fe8ae914127c708cbdfc.zip |
removed guiDrawKeymatrix
Diffstat (limited to 'gui.c')
-rw-r--r-- | gui.c | 86 |
1 files changed, 0 insertions, 86 deletions
@@ -24,57 +24,6 @@ static msg_t buttonThread(struct button_t *a) { } } -static msg_t keymatrixThread(struct keymatrix_t *a) { - uint16_t i, tpx, tpy, x0, y0, size, off; - - x0 = a->x0; - y0 = a->y0; - off = a->off; - size = a->size; - memset(a->number, 0, a->digits * sizeof(a->number)); - i = 0; - - while(TRUE) { - while(!tpIRQ()); - tpx = tpReadX(); - tpy = tpReadY(); - if(tpx >= x0 && tpx <= x0+size && tpy >= y0 && tpy <= y0+size) - a->number[i] = 7; - else if(tpx >= x0+off && tpx <= x0+off+size && tpy >= y0 && tpy <= y0+size) - a->number[i] = 8; - else if(tpx >= x0+off+off && tpx <= x0+off+off+size && tpy >= y0 && tpy <= y0+size) - a->number[i] = 9; - else if(tpx >= x0 && tpx <= x0+size && tpy >= y0+off && tpy <= y0+off+size) - a->number[i] = 4; - else if(tpx >= x0+off && tpx <= x0+off+size && tpy >= y0+off && tpy <= y0+off+size) - a->number[i] = 5; - else if(tpx >= x0+off+off && tpx <= x0+off+off+size && tpy >= y0+off && tpy <= y0+off+size) - a->number[i] = 6; - else if(tpx >= x0 && tpx <= x0+size && tpy >= y0+off+off && tpy <= y0+off+off+size) - a->number[i] = 1; - else if(tpx >= x0+off && tpx <= x0+off+size && tpy >= y0+off+off && tpy <= y0+off+off+size) - a->number[i] = 2; - else if(tpx >= x0+off+off && tpx <= x0+off+off+size && tpy >= y0+off+off && tpy <= y0+off+off+size) - a->number[i] = 3; - else if(tpx >= x0 && tpx <= x0+size && tpy >= y0+off+off+off && tpy <= y0+off+off+off+size) - a->number[i] = 0; - else if(tpx >= x0+off && tpx <= x0+off+size && tpy >= y0+off+off+off && tpy <= y0+off+off+off+size) - a->number[i] = 0; - else if(tpx >= x0+off+off && tpx <= x0+off+off+size && tpy >= y0+off+off+off && tpy <= y0+off+off+off+size) - a->number[i] = 0; - - if(i >= a->digits) { - i = 0; - memset(a->number, 0, a->digits * sizeof(a->number)); - } else { - i++; - } - - while(tpIRQ()); - chThdSleepMilliseconds(a->interval); - } -} - static msg_t TouchPadThread(uint16_t updateInterval) { chRegSetThreadName("GUI"); @@ -110,38 +59,3 @@ Thread *guiDrawButton(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, unsign return tp; } -Thread *guiDrawKeymatrix(uint16_t x0, uint16_t y0, uint16_t size, uint16_t space, uint16_t fontColor, uint16_t buttonColor, uint16_t interval, uint16_t digits, uint32_t *number) { - struct keymatrix_t *keymatrix; - Thread *tp = NULL; - uint16_t off; - uint8_t i, j; - - off = size+space; - - keymatrix = chHeapAlloc(NULL, sizeof(struct keymatrix_t)); - keymatrix->x0 = x0; - keymatrix->y0 = y0; - keymatrix->off = off; - keymatrix->size = size; - keymatrix->digits = digits; - keymatrix->number = number; - keymatrix->interval = interval; - - lcdDrawRectString(x0, y0, x0+size, y0+size, "7", fontColor, buttonColor); - lcdDrawRectString(x0+off, y0, x0+off+size, y0+size, "8", fontColor, buttonColor); - lcdDrawRectString(x0+off+off, y0, x0+off+off+size, y0+size, "9", fontColor, buttonColor); - lcdDrawRectString(x0, y0+off, x0+size, y0+off+size, "4", fontColor, buttonColor); - lcdDrawRectString(x0+off, y0+off, x0+off+size, y0+off+size, "5", fontColor, buttonColor); - lcdDrawRectString(x0+off+off, y0+off, x0+off+off+size, y0+off+size, "6", fontColor, buttonColor); - lcdDrawRectString(x0, y0+off+off, x0+size, y0+off+off+size, "1", fontColor, buttonColor); - lcdDrawRectString(x0+off, y0+off+off, x0+off+size, y0+off+off+size, "2", fontColor, buttonColor); - lcdDrawRectString(x0+off+off, y0+off+off, x0+off+off+size, y0+off+off+size, "3", fontColor, buttonColor); - lcdDrawRectString(x0, y0+off+off+off, x0+size, y0+off+off+off+size, "*", fontColor, buttonColor); - lcdDrawRectString(x0+off, y0+off+off+off, x0+off+size, y0+off+off+off+size, "0", fontColor, buttonColor); - lcdDrawRectString(x0+off+off, y0+off+off+off, x0+off+off+size, y0+off+off+off+size, "#", fontColor, buttonColor); - - tp = chThdCreateFromHeap(NULL, THD_WA_SIZE(64), NORMALPRIO, keymatrixThread, keymatrix); - - return tp; -} - |