From: asterix Date: Wed, 7 Jul 2010 16:08:30 +0000 (+0000) Subject: Use recv instead get. X-Git-Tag: 2.6.0~288^2~76 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=93722dec76aff95fab889b193b177df92dd9ee43;p=bertos.git Use recv instead get. git-svn-id: https://src.develer.com/svnoss/bertos/branches/i2c@4007 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/drv/eeprom.c b/bertos/drv/eeprom.c index 470d85cd..52ab70c7 100644 --- a/bertos/drv/eeprom.c +++ b/bertos/drv/eeprom.c @@ -248,20 +248,11 @@ static size_t eeprom_read(struct KFile *_fd, void *_buf, size_t size) return 0; } - while (size--) - { - /* - * The last byte read does not have an ACK - * to stop communication. - */ - int c = i2c_get(size); - if (c == EOF) - break; - - *buf++ = c; - fd->fd.seek_pos++; - rd_len++; + if (i2c_recv(buf, size)) + { + fd->fd.seek_pos += size; + rd_len += size; } i2c_stop();