aboutsummaryrefslogtreecommitdiff
path: root/ui.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2015-01-29 11:29:43 +0100
committerLars-Dominik Braun <lars@6xq.net>2015-01-29 11:29:43 +0100
commit708e9eb417ddf41ec345f2be70c4a32721608e4c (patch)
treed33c3c341f4a0aeac3966be3c6e1ca27eb94a7bc /ui.c
parentaf4ea653a341f3c25cfbb2e7ec4b633bf73913a7 (diff)
downloadhourglass-708e9eb417ddf41ec345f2be70c4a32721608e4c.tar.gz
hourglass-708e9eb417ddf41ec345f2be70c4a32721608e4c.tar.bz2
hourglass-708e9eb417ddf41ec345f2be70c4a32721608e4c.zip
Replace enums with uint8_t
Saves a few bytes, since enums are 16 bit
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/ui.c b/ui.c
index e45acaf..c7a2364 100644
--- a/ui.c
+++ b/ui.c
@@ -34,30 +34,30 @@
#define FLASH_CONFIRM_FINE_OFF FLASH_ENTER_FINE_OFF
#define FLASH_CONFIRM_FINE_NUM (2)
-typedef enum {
- /* initialize */
- UIMODE_INIT = 0,
- /* deep sleep */
- UIMODE_SLEEP,
- /* select time */
- UIMODE_SELECT_COARSE,
- UIMODE_SELECT_FINE,
- /* idle */
- UIMODE_IDLE,
- /* count time */
- UIMODE_RUN,
- /* flash leds */
- UIMODE_FLASH_ON,
- UIMODE_FLASH_OFF,
-} uimode;
-
-typedef enum {
- FLASH_NONE = 0,
- FLASH_ALARM,
- FLASH_ENTER_COARSE,
- FLASH_CONFIRM_COARSE,
- FLASH_CONFIRM_FINE,
-} flashmode;
+/* UI modes, enum would take 16 bits */
+typedef uint8_t uimode;
+/* initialize */
+#define UIMODE_INIT 0
+/* deep sleep */
+#define UIMODE_SLEEP 1
+/* select time */
+#define UIMODE_SELECT_COARSE 2
+#define UIMODE_SELECT_FINE 3
+/* idle */
+#define UIMODE_IDLE 4
+/* count time */
+#define UIMODE_RUN 5
+/* flash leds */
+#define UIMODE_FLASH_ON 6
+#define UIMODE_FLASH_OFF 7
+
+/* flash modes */
+typedef uint8_t flashmode;
+#define FLASH_NONE 0
+#define FLASH_ALARM 1
+#define FLASH_ENTER_COARSE 2
+#define FLASH_CONFIRM_COARSE 3
+#define FLASH_CONFIRM_FINE 4
/* nextmode is used for deciding which mode _FLASH transitions into */
static uimode mode = UIMODE_INIT;