Fix delays in generic i2c driver, reduce delays in ams sansa fmradio i2c driver (tested on m200v4, clip, e200v2, fuze).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21421 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Bertrik Sikken 2009-06-20 21:45:04 +00:00
parent e70a23a9d4
commit fa4135e43d
2 changed files with 2 additions and 3 deletions

View file

@ -91,9 +91,9 @@ static unsigned char i2c_inb(const struct i2c_interface *iface, bool ack)
iface->sda_input(); iface->sda_input();
iface->delay_su_dat();
/* clock in each bit, MSB first */ /* clock in each bit, MSB first */
for ( i=0x80; i; i>>=1 ) { for ( i=0x80; i; i>>=1 ) {
iface->delay_su_dat();
iface->scl_hi(); iface->scl_hi();
iface->delay_thigh(); iface->delay_thigh();
if (iface->sda()) if (iface->sda())
@ -123,7 +123,6 @@ static int i2c_outb(const struct i2c_interface *iface, unsigned char byte)
iface->scl_hi(); iface->scl_hi();
iface->delay_thigh(); iface->delay_thigh();
iface->scl_lo(); iface->scl_lo();
iface->delay_hd_dat();
} }
return i2c_getack(iface); return i2c_getack(iface);

View file

@ -111,7 +111,7 @@ static void fm_delay(void)
volatile int i; volatile int i;
/* this loop is uncalibrated and could use more sophistication */ /* this loop is uncalibrated and could use more sophistication */
for (i = 0; i < 100; i++) { for (i = 0; i < 20; i++) {
} }
} }