diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-05-16 21:20:52 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-05-16 21:20:52 +0000 |
commit | 250c3b65dfb0eccce25bf71d5b31d248b7b95c8a (patch) | |
tree | 03c2a04bbfffd2bd5113617debc77bfbc9b1b70e /firmware | |
parent | 0e085999d50578eff8bf89e71a88b9a9e05e3463 (diff) | |
download | rockbox-250c3b65dfb0eccce25bf71d5b31d248b7b95c8a.tar.gz rockbox-250c3b65dfb0eccce25bf71d5b31d248b7b95c8a.zip |
Now yields when waiting for flow control
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@607 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/i2c.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/firmware/drivers/i2c.c b/firmware/drivers/i2c.c index 3a5603ddd4..3ef2f48a6b 100644 --- a/firmware/drivers/i2c.c +++ b/firmware/drivers/i2c.c | |||
@@ -18,6 +18,7 @@ | |||
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | #include "lcd.h" | 19 | #include "lcd.h" |
20 | #include "sh7034.h" | 20 | #include "sh7034.h" |
21 | #include "kernel.h" | ||
21 | #include "debug.h" | 22 | #include "debug.h" |
22 | 23 | ||
23 | #define PB13 0x2000 | 24 | #define PB13 0x2000 |
@@ -94,7 +95,8 @@ void i2c_ack(int bit) | |||
94 | SDA_LO; | 95 | SDA_LO; |
95 | 96 | ||
96 | SCL_INPUT; /* Set the clock to input */ | 97 | SCL_INPUT; /* Set the clock to input */ |
97 | while(!SCL); /* and wait for the MAS to release it */ | 98 | while(!SCL) /* and wait for the MAS to release it */ |
99 | yield(); | ||
98 | 100 | ||
99 | DELAY; | 101 | DELAY; |
100 | SCL_OUTPUT; | 102 | SCL_OUTPUT; |
@@ -114,8 +116,9 @@ int i2c_getack(void) | |||
114 | SDA_INPUT; /* And set to input */ | 116 | SDA_INPUT; /* And set to input */ |
115 | SCL_LO; /* Set the clock low */ | 117 | SCL_LO; /* Set the clock low */ |
116 | SCL_INPUT; /* Set the clock to input */ | 118 | SCL_INPUT; /* Set the clock to input */ |
117 | while(!SCL); /* and wait for the MAS to release it */ | 119 | while(!SCL) /* and wait for the MAS to release it */ |
118 | 120 | yield(); | |
121 | |||
119 | x = SDA; | 122 | x = SDA; |
120 | if (x) | 123 | if (x) |
121 | /* ack failed */ | 124 | /* ack failed */ |