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 /i2c.h | |
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 'i2c.h')
-rw-r--r-- | i2c.h | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -1,17 +1,17 @@ #ifndef TW_H #define TW_H -typedef enum { - TWM_INVALID = 0, - TWM_WRITE, - TWM_READ, -} twMode; - -typedef enum { - TWST_WAIT = 0, - TWST_OK = 1, - TWST_ERR = 2, -} twStatus; +#include <stdint.h> + +typedef uint8_t twMode; +#define TWM_INVALID 0 +#define TWM_WRITE 1 +#define TWM_READ 2 + +typedef uint8_t twStatus; +#define TWST_WAIT 0 +#define TWST_OK 1 +#define TWST_ERR 2 #include <stdint.h> |