diff options
author | Brandon Low <lostlogic@rockbox.org> | 2006-03-09 19:47:12 +0000 |
---|---|---|
committer | Brandon Low <lostlogic@rockbox.org> | 2006-03-09 19:47:12 +0000 |
commit | 19f4c2a093698940482aad6df0bd8478a82f2a9d (patch) | |
tree | 66de55749bcaaf45d95b828423ffca8c715b7112 /firmware/drivers/pcf50605.c | |
parent | 5ecac908a2738e7a83dc0227daef3aaf16787dbc (diff) |
Improve ipod i2c driver somewhat by at least taking advantage of the in-device addressing in the pcf50605, also switch to a 10bit resistive divider for the ipod battery reading, this is easily configurable if it needs changing, or even to become a user/runtime setting
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8980 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/pcf50605.c')
-rw-r--r-- | firmware/drivers/pcf50605.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/firmware/drivers/pcf50605.c b/firmware/drivers/pcf50605.c index c8ea4a499f..a8c61b1789 100644 --- a/firmware/drivers/pcf50605.c +++ b/firmware/drivers/pcf50605.c @@ -23,6 +23,7 @@ * KIND, either express or implied. * ****************************************************************************/ +#include "system.h" #include "config.h" #if CONFIG_I2C == I2C_PP5020 #include "i2c-pp5020.h" @@ -72,15 +73,8 @@ int pcf50605_read(int address) int pcf50605_read_multiple(int address, unsigned char* buf, int count) { - int i; - - for (i=0;i<count;i++) - { - buf[i]=pcf50605_read(address); - address++; - } - - return 0; + int read = i2c_readbytes(0x08, address, count, buf); + return read - count; } int pcf50605_write(int address, unsigned char val) |