diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-01-21 19:37:29 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-01-21 19:37:29 +0000 |
commit | aaa8443af95aa03b225cea935ff49691ec94d0f9 (patch) | |
tree | bfca9b50d6ae6c1cedaf43bec47167ddbddb68c2 /firmware/drivers/i2c.c | |
parent | 1774d4d885bd6abab5096b1ea4f57e06caed501f (diff) | |
download | rockbox-aaa8443af95aa03b225cea935ff49691ec94d0f9.tar.gz rockbox-aaa8443af95aa03b225cea935ff49691ec94d0f9.zip |
Based on Ludovic Lange excellent work, I've modified things to increase
likeliness that this works on an FM Recorder.
Reports please!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3143 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/i2c.c')
-rw-r--r-- | firmware/drivers/i2c.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/drivers/i2c.c b/firmware/drivers/i2c.c index ccd11e01de..97d7a511e1 100644 --- a/firmware/drivers/i2c.c +++ b/firmware/drivers/i2c.c | |||
@@ -124,7 +124,7 @@ int i2c_getack(void) | |||
124 | low until it is ready. We need to poll the clock line until it goes | 124 | low until it is ready. We need to poll the clock line until it goes |
125 | high before we read the ack. */ | 125 | high before we read the ack. */ |
126 | 126 | ||
127 | #ifndef ARCHOS_RECORDER | 127 | #ifdef HAVE_I2C_LOW_FIRST |
128 | SDA_LO; /* First, discharge the data line */ | 128 | SDA_LO; /* First, discharge the data line */ |
129 | #endif | 129 | #endif |
130 | SDA_INPUT; /* And set to input */ | 130 | SDA_INPUT; /* And set to input */ |
@@ -167,7 +167,7 @@ unsigned char i2c_inb(int ack) | |||
167 | 167 | ||
168 | /* clock in each bit, MSB first */ | 168 | /* clock in each bit, MSB first */ |
169 | for ( i=0x80; i; i>>=1 ) { | 169 | for ( i=0x80; i; i>>=1 ) { |
170 | #ifndef ARCHOS_RECORDER | 170 | #ifdef HAVE_I2C_LOW_FIRST |
171 | /* Tricky business. Here we discharge the data line by driving it low | 171 | /* Tricky business. Here we discharge the data line by driving it low |
172 | and then set it to input to see if it stays low or goes high */ | 172 | and then set it to input to see if it stays low or goes high */ |
173 | SDA_LO; /* First, discharge the data line */ | 173 | SDA_LO; /* First, discharge the data line */ |