From 5bbd76804d22b80c80a97d01a634ddc6c5433383 Mon Sep 17 00:00:00 2001 From: "Dennis Real (DL9CAT)" Date: Mon, 21 Oct 2019 16:57:59 +0200 Subject: [PATCH] update version info --- ui.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/ui.c b/ui.c index 899e051..9b127ce 100644 --- a/ui.c +++ b/ui.c @@ -34,23 +34,23 @@ uistat_t uistat = { -#define NO_EVENT 0 -#define EVT_BUTTON_SINGLE_CLICK 0x01 -#define EVT_BUTTON_DOUBLE_CLICK 0x02 -#define EVT_BUTTON_DOWN_LONG 0x04 -#define EVT_UP 0x10 -#define EVT_DOWN 0x20 -#define EVT_REPEAT 0x40 +#define NO_EVENT 0 +#define EVT_BUTTON_SINGLE_CLICK 0x01 +#define EVT_BUTTON_DOUBLE_CLICK 0x02 +#define EVT_BUTTON_DOWN_LONG 0x04 +#define EVT_UP 0x10 +#define EVT_DOWN 0x20 +#define EVT_REPEAT 0x40 -#define BUTTON_DOWN_LONG_TICKS 5000 /* 1sec */ -#define BUTTON_DOUBLE_TICKS 5000 /* 500ms */ -#define BUTTON_REPEAT_TICKS 1000 /* 100ms */ -#define BUTTON_DEBOUNCE_TICKS 200 +#define BUTTON_DOWN_LONG_TICKS 5000 /* 1sec */ +#define BUTTON_DOUBLE_TICKS 5000 /* 500ms */ +#define BUTTON_REPEAT_TICKS 1000 /* 100ms */ +#define BUTTON_DEBOUNCE_TICKS 200 /* lever switch assignment */ -#define BIT_UP1 3 -#define BIT_PUSH 2 -#define BIT_DOWN1 1 +#define BIT_UP1 3 +#define BIT_PUSH 2 +#define BIT_DOWN1 1 #define READ_PORT() palReadPort(GPIOA) #define BUTTON_MASK 0b1111 @@ -122,10 +122,10 @@ static void menu_push_submenu(const menuitem_t *submenu); static int btn_check(void) { int cur_button = READ_PORT() & BUTTON_MASK; - int changed = last_button ^ cur_button; - int status = 0; + int changed = last_button ^ cur_button; + int status = 0; uint32_t ticks = chVTGetSystemTime(); - if (changed & (1<= BUTTON_DEBOUNCE_TICKS) { if (cur_button & (1<