#include "eeprom.h"
#warning TODO:Test and complete this module for arm platform.
+#if !CPU_ARM
-#if 0
#include <cfg/macros.h> // MIN()
#include <cfg/debug.h>
#include <cfg/module.h> // MOD_CHECK()
*/
static size_t eeprom_writeRaw(struct KFile *_fd, const void *buf, size_t size)
{
- Eeprom *fd = EEPROM(_fd);
+ Eeprom *fd = EEPROM_CAST(_fd);
e2dev_addr_t dev_addr;
uint8_t addr_buf[2];
uint8_t addr_len;
/* clamp size to memory limit (otherwise may roll back) */
ASSERT(_fd->seek_pos + size <= (kfile_off_t)_fd->size);
- size = MIN((kfile_size_t)size, _fd->size - _fd->seek_pos);
+ size = MIN((kfile_off_t)size, _fd->size - _fd->seek_pos);
if (mem_info[fd->type].has_dev_addr)
{
*/
static size_t eeprom_writeVerify(struct KFile *_fd, const void *_buf, size_t size)
{
- Eeprom *fd = EEPROM(_fd);
+ Eeprom *fd = EEPROM_CAST(_fd);
int retries = 5;
size_t wr_len;
*/
static size_t eeprom_read(struct KFile *_fd, void *_buf, size_t size)
{
- Eeprom *fd = EEPROM(_fd);
+ Eeprom *fd = EEPROM_CAST(_fd);
uint8_t addr_buf[2];
uint8_t addr_len;
size_t rd_len = 0;
/* clamp size to memory limit (otherwise may roll back) */
ASSERT(_fd->seek_pos + size <= (kfile_off_t)_fd->size);
- size = MIN((kfile_size_t)size, _fd->size - _fd->seek_pos);
+ size = MIN((kfile_off_t)size, _fd->size - _fd->seek_pos);
e2dev_addr_t dev_addr;
if (mem_info[fd->type].has_dev_addr)
while (size--)
{
/*
- * The last byte read does not has an ACK
+ * The last byte read does not have an ACK
* to stop communication.
*/
int c = twi_get(size);
fd->fd.seek = kfile_genericSeek;
}
+
+#endif