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 --- i2c.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'i2c.h') diff --git a/i2c.h b/i2c.h index 1090ee2..fb481e3 100644 --- a/i2c.h +++ b/i2c.h @@ -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 + +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 -- cgit v1.2.3