forked from len0rd/rockbox
pcf50605_write_multiple must prelock driver or the series of bytes may be interrupted resulting in something you didn't intend. :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15807 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e711de2974
commit
9beb210007
1 changed files with 6 additions and 0 deletions
|
|
@ -91,8 +91,14 @@ int pcf50605_write(int address, unsigned char val)
|
|||
int pcf50605_write_multiple(int address, const unsigned char* buf, int count)
|
||||
{
|
||||
int i;
|
||||
|
||||
i2c_lock();
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
pp_i2c_send(0x8, address + i, buf[i]);
|
||||
|
||||
i2c_unlock();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue