ASSERT(fd->fd.seek_pos + size <= fd->fd.size);
- size = MIN((uint32_t)size, fd->fd.size - fd->fd.seek_pos);
+ size = MIN((kfile_size_t)size, fd->fd.size - fd->fd.seek_pos);
kprintf("Reading at pos[%lu]\n", fd->fd.seek_pos);
const uint8_t *data = (const uint8_t *) _buf;
ASSERT(fd->fd.seek_pos + size <= fd->fd.size);
- size = MIN((uint32_t)size, fd->fd.size - fd->fd.seek_pos);
+ size = MIN((kfile_size_t)size, fd->fd.size - fd->fd.seek_pos);
kprintf("Writing at pos[%lu]\n", fd->fd.seek_pos);
offset = fd->fd.seek_pos % mem_info[fd->dev].page_size;
- size_t wr_len = MIN(size, mem_info[fd->dev].page_size - offset);
+ size_t wr_len = MIN((dataflash_size_t)size, mem_info[fd->dev].page_size - offset);
kprintf(" [page-<%ld>, byte-<%ld>]",new_page, offset);
*
* \brief Function library for AT45DB081D Flash memory.
*
- *
* \version $Id: dataflash.h 20677 2008-02-19 14:29:52Z batt $
+ *
* \author Daniele Basile <asterix@develer.com>
*/
#ifndef DRV_DATAFLASH_H
#define DRV_DATAFLASH_H
-#include <kern/kfile.h>
#include <cfg/compiler.h>
+#include <kern/kfile.h>
+
/**
* Type definitions for dflash memory.
* \{
*/
typedef enum DataflashType
{
- DFT_AT45DB041B,
+ DFT_AT45DB041B = 0,
DFT_AT45DB081D,
DFT_AT45DB161D,
+ DFT_AT45DB642D,
DFT_CNT
} DataflashType;