*/
static int dataflash_flush(KFile *_fd)
{
- DataFlash *fd = DATAFLASH(_fd);
+ DataFlash *fd = DATAFLASH_CAST(_fd);
if (fd->page_dirty)
{
dataflash_cmd(fd, fd->current_page, 0x00, DFO_WRITE_BUFF1_TO_MEM_E);
*/
static KFile *dataflash_reopen(KFile *_fd)
{
- DataFlash *fd = DATAFLASH(_fd);
+ DataFlash *fd = DATAFLASH_CAST(_fd);
dataflash_close(_fd);
fd->current_page = 0;
*/
static size_t dataflash_read(struct KFile *_fd, void *buf, size_t size)
{
- DataFlash *fd = DATAFLASH(_fd);
+ DataFlash *fd = DATAFLASH_CAST(_fd);
dataflash_offset_t byte_addr;
dataflash_page_t page_addr;
*/
static size_t dataflash_write(struct KFile *_fd, const void *_buf, size_t size)
{
- DataFlash *fd = DATAFLASH(_fd);
+ DataFlash *fd = DATAFLASH_CAST(_fd);
dataflash_offset_t offset;
dataflash_page_t new_page;
/**
* Convert + ASSERT from generic KFile to DataFlash.
*/
-INLINE DataFlash * DATAFLASH(KFile *fd)
+INLINE DataFlash * DATAFLASH_CAST(KFile *fd)
{
ASSERT(fd->_type == KFT_DATAFLASH);
return (DataFlash *)fd;