From 708e9eb417ddf41ec345f2be70c4a32721608e4c Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Thu, 29 Jan 2015 11:29:43 +0100 Subject: Replace enums with uint8_t Saves a few bytes, since enums are 16 bit --- gyro.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gyro.c') 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 */ -- cgit v1.2.3