From 57b51830d62ccdf55bcce96b6956219288592dfa Mon Sep 17 00:00:00 2001 From: Michael Sparmann Date: Mon, 5 Oct 2009 12:29:14 +0000 Subject: Reduce impact of lost interrupts on S5L8700 I2C git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22953 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/s5l8700/i2c-s5l8700.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'firmware/target/arm/s5l8700/i2c-s5l8700.c') 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; } -- cgit v1.2.3