fixed active/inactive state of GUI elements

This commit is contained in:
Tectu 2012-06-26 13:44:10 +02:00
parent 87888e474d
commit bbfc18bc27
2 changed files with 8 additions and 6 deletions

12
gui.c
View File

@ -56,7 +56,7 @@ static void deleteNode(char *name) {
}
}
static void printNodes(BaseSequentialStream *chp) {
void guiPrintNodes(BaseSequentialStream *chp) {
struct guiNode_t *pointer = firstGUI;
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, "y1: %d\r\n", pointer->y1);
chprintf(chp, "name: %s\r\n", pointer->name);
chprintf(chp, "*active: 0x%x\r\n", pointer->active);
chprintf(chp, "*state: 0x%x\r\n", pointer->state);
chprintf(chp, "active: %d\r\n", *(pointer->active));
chprintf(chp, "state: %d\r\n", *(pointer->state));
chprintf(chp, "*next: 0x%x\r\n", pointer->next);
chprintf(chp, "\r\n\n");
pointer = pointer->next;
@ -91,9 +91,11 @@ static void guiThread(const uint16_t interval) {
*(node->state) = 1;
else
*(node->state) = 0;
chThdSleepMilliseconds(interval);
} else {
*(node->state) = 0;
}
chThdSleepMilliseconds(interval);
}
chThdSleepMilliseconds(interval);

2
gui.h
View File

@ -25,7 +25,7 @@ enum {horizontal, vertical};
enum {inactive, active};
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);
#ifdef __cplusplus