From 93722dec76aff95fab889b193b177df92dd9ee43 Mon Sep 17 00:00:00 2001 From: asterix Date: Wed, 7 Jul 2010 16:08:30 +0000 Subject: [PATCH] Use recv instead get. git-svn-id: https://src.develer.com/svnoss/bertos/branches/i2c@4007 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/drv/eeprom.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) 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(); -- 2.25.1