summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorMichael Sparmann <theseven@rockbox.org>2009-10-05 12:29:14 +0000
committerMichael Sparmann <theseven@rockbox.org>2009-10-05 12:29:14 +0000
commit57b51830d62ccdf55bcce96b6956219288592dfa (patch)
treeea32f230c980452ab05de6807ec06d4c7580a30b /firmware/target/arm
parent385e821d04b4e0fbd87a163123759995f6e8e9f1 (diff)
Reduce impact of lost interrupts on S5L8700 I2C
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22953 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/s5l8700/i2c-s5l8700.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/firmware/target/arm/s5l8700/i2c-s5l8700.c b/firmware/target/arm/s5l8700/i2c-s5l8700.c
index 762db9abc2..5b55334b25 100644
--- a/firmware/target/arm/s5l8700/i2c-s5l8700.c
+++ b/firmware/target/arm/s5l8700/i2c-s5l8700.c
@@ -85,20 +85,20 @@ int i2c_write(unsigned char slave, int address, int len, const unsigned char *da
IICDS = slave & ~1;
IICSTAT = 0xF0;
IICCON = 0xF3;
- wakeup_wait(&i2c_wakeup, TIMEOUT_BLOCK);
+ while ((IICCON & 0x10) == 0) wakeup_wait(&i2c_wakeup, 1);
if (address >= 0) {
/* write address */
IICDS = address;
IICCON = 0xF3;
- wakeup_wait(&i2c_wakeup, TIMEOUT_BLOCK);
+ while ((IICCON & 0x10) == 0) wakeup_wait(&i2c_wakeup, 1);
}
/* write data */
while (len--) {
IICDS = *data++;
IICCON = 0xF3;
- wakeup_wait(&i2c_wakeup, TIMEOUT_BLOCK);
+ while ((IICCON & 0x10) == 0) wakeup_wait(&i2c_wakeup, 1);
}
/* STOP */
@@ -119,23 +119,23 @@ int i2c_read(unsigned char slave, int address, int len, unsigned char *data)
IICDS = slave & ~1;
IICSTAT = 0xF0;
IICCON = 0xF3;
- wakeup_wait(&i2c_wakeup, TIMEOUT_BLOCK);
+ while ((IICCON & 0x10) == 0) wakeup_wait(&i2c_wakeup, 1);
/* write address */
IICDS = address;
IICCON = 0xF3;
- wakeup_wait(&i2c_wakeup, TIMEOUT_BLOCK);
+ while ((IICCON & 0x10) == 0) wakeup_wait(&i2c_wakeup, 1);
}
/* (repeated) START */
IICDS = slave | 1;
IICSTAT = 0xB0;
IICCON = 0xF3;
- wakeup_wait(&i2c_wakeup, TIMEOUT_BLOCK);
+ while ((IICCON & 0x10) == 0) wakeup_wait(&i2c_wakeup, 1);
while (len--) {
IICCON = (len == 0) ? 0x73 : 0xF3; /* NACK or ACK */
- wakeup_wait(&i2c_wakeup, TIMEOUT_BLOCK);
+ while ((IICCON & 0x10) == 0) wakeup_wait(&i2c_wakeup, 1);
*data++ = IICDS;
}