diff options
Diffstat (limited to 'firmware/drivers/i2c.c')
-rw-r--r-- | firmware/drivers/i2c.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/drivers/i2c.c b/firmware/drivers/i2c.c index 5aa822e83b..ccd11e01de 100644 --- a/firmware/drivers/i2c.c +++ b/firmware/drivers/i2c.c | |||
@@ -41,6 +41,18 @@ | |||
41 | /* arbitrary delay loop */ | 41 | /* arbitrary delay loop */ |
42 | #define DELAY do { int _x; for(_x=0;_x<20;_x++);} while (0) | 42 | #define DELAY do { int _x; for(_x=0;_x<20;_x++);} while (0) |
43 | 43 | ||
44 | static struct mutex i2c_mtx; | ||
45 | |||
46 | void i2c_begin(void) | ||
47 | { | ||
48 | mutex_lock(&i2c_mtx); | ||
49 | } | ||
50 | |||
51 | void i2c_end(void) | ||
52 | { | ||
53 | mutex_unlock(&i2c_mtx); | ||
54 | } | ||
55 | |||
44 | void i2c_start(void) | 56 | void i2c_start(void) |
45 | { | 57 | { |
46 | SDA_OUTPUT; | 58 | SDA_OUTPUT; |