fixed active/inactive state of GUI elements
This commit is contained in:
parent
87888e474d
commit
bbfc18bc27
2 changed files with 8 additions and 6 deletions
10
gui.c
10
gui.c
|
@ -56,7 +56,7 @@ static void deleteNode(char *name) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void printNodes(BaseSequentialStream *chp) {
|
void guiPrintNodes(BaseSequentialStream *chp) {
|
||||||
struct guiNode_t *pointer = firstGUI;
|
struct guiNode_t *pointer = firstGUI;
|
||||||
|
|
||||||
chprintf(chp, "\r\n\nguiNodes:\r\n\n");
|
chprintf(chp, "\r\n\nguiNodes:\r\n\n");
|
||||||
|
@ -67,8 +67,8 @@ static void printNodes(BaseSequentialStream *chp) {
|
||||||
chprintf(chp, "x1: %d\r\n", pointer->x1);
|
chprintf(chp, "x1: %d\r\n", pointer->x1);
|
||||||
chprintf(chp, "y1: %d\r\n", pointer->y1);
|
chprintf(chp, "y1: %d\r\n", pointer->y1);
|
||||||
chprintf(chp, "name: %s\r\n", pointer->name);
|
chprintf(chp, "name: %s\r\n", pointer->name);
|
||||||
chprintf(chp, "*active: 0x%x\r\n", pointer->active);
|
chprintf(chp, "active: %d\r\n", *(pointer->active));
|
||||||
chprintf(chp, "*state: 0x%x\r\n", pointer->state);
|
chprintf(chp, "state: %d\r\n", *(pointer->state));
|
||||||
chprintf(chp, "*next: 0x%x\r\n", pointer->next);
|
chprintf(chp, "*next: 0x%x\r\n", pointer->next);
|
||||||
chprintf(chp, "\r\n\n");
|
chprintf(chp, "\r\n\n");
|
||||||
pointer = pointer->next;
|
pointer = pointer->next;
|
||||||
|
@ -91,10 +91,12 @@ static void guiThread(const uint16_t interval) {
|
||||||
*(node->state) = 1;
|
*(node->state) = 1;
|
||||||
else
|
else
|
||||||
*(node->state) = 0;
|
*(node->state) = 0;
|
||||||
|
} else {
|
||||||
|
*(node->state) = 0;
|
||||||
|
}
|
||||||
|
|
||||||
chThdSleepMilliseconds(interval);
|
chThdSleepMilliseconds(interval);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
chThdSleepMilliseconds(interval);
|
chThdSleepMilliseconds(interval);
|
||||||
}
|
}
|
||||||
|
|
2
gui.h
2
gui.h
|
@ -25,7 +25,7 @@ enum {horizontal, vertical};
|
||||||
enum {inactive, active};
|
enum {inactive, active};
|
||||||
|
|
||||||
Thread *guiInit(uint16_t interval);
|
Thread *guiInit(uint16_t interval);
|
||||||
void printNode(BaseSequentialStream *chp);
|
void guiPrintNode(BaseSequentialStream *chp);
|
||||||
uint8_t guiDrawButton(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, char *str, uint16_t fontColor, uint16_t buttonColor, uint8_t *active, uint8_t *state);
|
uint8_t guiDrawButton(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, char *str, uint16_t fontColor, uint16_t buttonColor, uint8_t *active, uint8_t *state);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
Loading…
Add table
Reference in a new issue