implemented GUI button drawing
This commit is contained in:
parent
588429506c
commit
87888e474d
1 changed files with 14 additions and 3 deletions
13
gui.c
13
gui.c
|
@ -56,7 +56,7 @@ static void deleteNode(char *name) {
|
|||
}
|
||||
}
|
||||
|
||||
void printNodes(BaseSequentialStream *chp) {
|
||||
static void printNodes(BaseSequentialStream *chp) {
|
||||
struct guiNode_t *pointer = firstGUI;
|
||||
|
||||
chprintf(chp, "\r\n\nguiNodes:\r\n\n");
|
||||
|
@ -82,9 +82,20 @@ static void guiThread(const uint16_t interval) {
|
|||
chRegSetThreadName("GUI");
|
||||
|
||||
while(TRUE) {
|
||||
for(node = firstGUI; node; node = node->next) {
|
||||
if(*(node->active) == active) {
|
||||
x = tpReadX();
|
||||
y = tpReadY();
|
||||
|
||||
if(x >= node->x0 && x <= node->x1 && y >= node->y0 && y <= node->y1)
|
||||
*(node->state) = 1;
|
||||
else
|
||||
*(node->state) = 0;
|
||||
|
||||
chThdSleepMilliseconds(interval);
|
||||
}
|
||||
}
|
||||
|
||||
chThdSleepMilliseconds(interval);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue