aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gui.c12
-rw-r--r--gui.h2
2 files changed, 8 insertions, 6 deletions
diff --git a/gui.c b/gui.c
index c4bf6865..6e8198ef 100644
--- a/gui.c
+++ b/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;
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);
diff --git a/gui.h b/gui.h
index d9faa6fd..4a6f741f 100644
--- a/gui.h
+++ b/gui.h
@@ -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