* invalidate any other reasons why the executable file might be covered by
* the GNU General Public License.
*
- * Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2003, 2004, 2005, 2010 Develer S.r.l. (http://www.develer.com/)
*
* -->
*
#include "eeprom.h"
+#include "cfg/cfg_i2c.h"
+
#include <cfg/macros.h> // MIN()
#include <cfg/debug.h>
#include <cfg/module.h> // MOD_CHECK()
STATIC_ASSERT(countof(mem_info) == EEPROM_CNT);
+#if !CONFIG_I2C_DISABLE_OLD_API
/**
* Copy \a size bytes from buffer \a buf to
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();
fd->fd.seek = kfile_genericSeek;
}
-#endif
+#endif /* !CONFIG_I2C_DISABLE_OLD_API */