diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-06-24 10:34:24 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-06-24 10:34:24 +0000 |
commit | b922a96ae3c6fb7e117923512108a4b3056469c1 (patch) | |
tree | bf736ebb8bcb7b246393d9ff97d6b403d283c3a0 /firmware/drivers/i2c.c | |
parent | 6a6217a2e580c7fa6cdfe90763d52c3a399d563a (diff) |
Added functions for exclusive I2C access
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1144 a1c6a512-1295-4272-9138-f99709370657
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 @@ /* arbitrary delay loop */ #define DELAY do { int _x; for(_x=0;_x<20;_x++);} while (0) +static struct mutex i2c_mtx; + +void i2c_begin(void) +{ + mutex_lock(&i2c_mtx); +} + +void i2c_end(void) +{ + mutex_unlock(&i2c_mtx); +} + void i2c_start(void) { SDA_OUTPUT; |