aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-06-09 16:22:08 +0200
committerTectu <joel@unormal.org>2012-06-09 16:22:08 +0200
commit4cccbb1711b73d8f6ca9fe8ae914127c708cbdfc (patch)
tree92c987203ec7585fda16d57f4054afa404d23037
parente78a6130786c7d803278483a6579cdd0d40c37b1 (diff)
downloaduGFX-4cccbb1711b73d8f6ca9fe8ae914127c708cbdfc.tar.gz
uGFX-4cccbb1711b73d8f6ca9fe8ae914127c708cbdfc.tar.bz2
uGFX-4cccbb1711b73d8f6ca9fe8ae914127c708cbdfc.zip
removed guiDrawKeymatrix
-rw-r--r--gui.c86
-rw-r--r--gui.h19
2 files changed, 0 insertions, 105 deletions
diff --git a/gui.c b/gui.c
index 735a5d04..ec3cc22c 100644
--- a/gui.c
+++ b/gui.c
@@ -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;
-}
-
diff --git a/gui.h b/gui.h
index 8589edca..443f31b3 100644
--- a/gui.h
+++ b/gui.h
@@ -10,16 +10,6 @@ struct button_t {
uint16_t interval;
};
-struct keymatrix_t {
- uint16_t x0;
- uint16_t y0;
- uint16_t off;
- uint16_t size;
- uint16_t digits;
- uint32_t *number;
- uint16_t interval;
-};
-
/*
* Description: starts main GUI thread which keeps X and Y coordinates of touchpad updated for guiDraw() threads
*
@@ -44,14 +34,5 @@ void guiInit(uint16_t updateIntervl);
*/
Thread *guiDrawButton(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, unsigned char *str, uint16_t fontColor, uint16_t buttonColor, uint16_t inverval, uint8_t *state);
-/*
- * Description: draws keymatrix
- *
- * param:
- *
- * return: pointer to created thread
- */
-Thread *guiDrawKeymatrix(uint16_t x0, uint16_t y0, uint16_t size, uint16_t space, uint16_t fontColor, uint16_t buttonColor, uint16_t inverval, uint16_t digits, uint32_t *number);
-
#endif