From: Keith Packard Date: Thu, 3 Sep 2009 04:57:54 +0000 (-0700) Subject: Make eeprom reads and writes across block boundary work X-Git-Tag: debian/0.5+77+gc57bd7f~34^2~2 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=7d39f17684feb49ac8a0017902158f298696e37c Make eeprom reads and writes across block boundary work Reading and writing across the block boundary was not stepping the eeprom position after the partial i/o operation at the end of the first block. This meant that the operation would re-use the end of the previous block, either re-reading or re-writing it. Signed-off-by: Keith Packard --- diff --git a/src/ao_ee.c b/src/ao_ee.c index f299b925..9b6db234 100644 --- a/src/ao_ee.c +++ b/src/ao_ee.c @@ -271,6 +271,7 @@ ao_ee_write(uint32_t pos, uint8_t *buf, uint16_t len) __reentrant /* See how much is left */ buf += this_len; len -= this_len; + pos += this_len; } return 1; } @@ -306,6 +307,7 @@ ao_ee_read(uint32_t pos, uint8_t *buf, uint16_t len) __reentrant /* See how much is left */ buf += this_len; len -= this_len; + pos += this_len; } return 1; }