diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2015-01-29 11:29:43 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2015-01-29 11:29:43 +0100 |
commit | 708e9eb417ddf41ec345f2be70c4a32721608e4c (patch) | |
tree | d33c3c341f4a0aeac3966be3c6e1ca27eb94a7bc /gyro.c | |
parent | af4ea653a341f3c25cfbb2e7ec4b633bf73913a7 (diff) | |
download | hourglass-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.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 */ |