aboutsummaryrefslogtreecommitdiff
path: root/gyro.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 /gyro.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 'gyro.c')
-rw-r--r--gyro.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gyro.c b/gyro.c
index 14e25ed..3079c20 100644
--- a/gyro.c
+++ b/gyro.c
@@ -26,7 +26,15 @@ static volatile int16_t zval = 0;
static int32_t zaccum = 0;
/* calculated zticks */
static int16_t zticks = 0;
-static enum {STOPPED = 0, START_REQUEST, STARTING, STOP_REQUEST, STOPPING, READING, IDLE} state = STOPPED;
+
+#define STOPPED 0
+#define START_REQUEST 1
+#define STARTING 2
+#define STOP_REQUEST 3
+#define STOPPING 4
+#define READING 5
+#define IDLE 6
+static uint8_t state = STOPPED;
/* data ready interrupt
*/