summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-08-17 18:23:50 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-08-17 18:23:50 +0000
commitf5e78674ffb08fbea9fa56fda0d88c97a7a03041 (patch)
tree9c18aaf331f9d2a9963c23c13c7d3bae2f3f1b5d
parentf70e45ac298dd9737c13f28ab95d6a628337e3af (diff)
downloadrockbox-f5e78674ffb08fbea9fa56fda0d88c97a7a03041.tar.gz
rockbox-f5e78674ffb08fbea9fa56fda0d88c97a7a03041.zip
Prevent unlikely endless loop.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10637 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/eeprom_24cxx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/firmware/drivers/eeprom_24cxx.c b/firmware/drivers/eeprom_24cxx.c
index 66bc235052..e045a13fa6 100644
--- a/firmware/drivers/eeprom_24cxx.c
+++ b/firmware/drivers/eeprom_24cxx.c
@@ -46,7 +46,7 @@
46#define SCL ( 0x00001000 & GPIO_READ) 46#define SCL ( 0x00001000 & GPIO_READ)
47#define SCL_OUT_LO and_l(~0x00001000, &GPIO_OUT) 47#define SCL_OUT_LO and_l(~0x00001000, &GPIO_OUT)
48#define SCL_LO or_l( 0x00001000, &GPIO_ENABLE) 48#define SCL_LO or_l( 0x00001000, &GPIO_ENABLE)
49#define SCL_HI and_l(~0x00001000, &GPIO_ENABLE); while(!SCL); 49#define SCL_HI and_l(~0x00001000, &GPIO_ENABLE)
50 50
51/* SDA is GPIO1, 13 */ 51/* SDA is GPIO1, 13 */
52#define SDA ( 0x00002000 & GPIO1_READ) 52#define SDA ( 0x00002000 & GPIO1_READ)
@@ -92,6 +92,7 @@ static void sw_i2c_stop(void)
92static void sw_i2c_ack(void) 92static void sw_i2c_ack(void)
93{ 93{
94 SCL_LO; 94 SCL_LO;
95 DELAY;
95 SDA_LO; 96 SDA_LO;
96 DELAY; 97 DELAY;
97 98
@@ -105,6 +106,7 @@ static bool sw_i2c_getack(void)
105 int count = 10; 106 int count = 10;
106 107
107 SCL_LO; 108 SCL_LO;
109 DELAY;
108 SDA_HI; /* sets to input */ 110 SDA_HI; /* sets to input */
109 DELAY; 111 DELAY;
110 SCL_HI; 112 SCL_HI;