From e02e81bcb2dde538e13ce9620560abfded8ec681 Mon Sep 17 00:00:00 2001 From: qwert Date: Wed, 6 Aug 2008 13:17:54 +0000 Subject: [PATCH] Refactor Dataflash macro to the new name specs. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1558 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/drv/dataflash.c | 8 ++++---- bertos/drv/dataflash.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bertos/drv/dataflash.c b/bertos/drv/dataflash.c index 43eca7de..5347d451 100644 --- a/bertos/drv/dataflash.c +++ b/bertos/drv/dataflash.c @@ -287,7 +287,7 @@ static void dataflash_loadPage(DataFlash *fd, dataflash_page_t page_addr) */ static int dataflash_flush(KFile *_fd) { - DataFlash *fd = DATAFLASHKFILE(_fd); + DataFlash *fd = DATAFLASH(_fd); if (fd->page_dirty) { dataflash_cmd(fd, fd->current_page, 0x00, DFO_WRITE_BUFF1_TO_MEM_E); @@ -316,7 +316,7 @@ static int dataflash_close(struct KFile *_fd) */ static KFile *dataflash_reopen(KFile *_fd) { - DataFlash *fd = DATAFLASHKFILE(_fd); + DataFlash *fd = DATAFLASH(_fd); dataflash_close(_fd); fd->current_page = 0; @@ -344,7 +344,7 @@ static KFile *dataflash_reopen(KFile *_fd) */ static size_t dataflash_read(struct KFile *_fd, void *buf, size_t size) { - DataFlash *fd = DATAFLASHKFILE(_fd); + DataFlash *fd = DATAFLASH(_fd); dataflash_offset_t byte_addr; dataflash_page_t page_addr; @@ -394,7 +394,7 @@ static size_t dataflash_read(struct KFile *_fd, void *buf, size_t size) */ static size_t dataflash_write(struct KFile *_fd, const void *_buf, size_t size) { - DataFlash *fd = DATAFLASHKFILE(_fd); + DataFlash *fd = DATAFLASH(_fd); dataflash_offset_t offset; dataflash_page_t new_page; diff --git a/bertos/drv/dataflash.h b/bertos/drv/dataflash.h index 1ad87ef4..ff5b662b 100644 --- a/bertos/drv/dataflash.h +++ b/bertos/drv/dataflash.h @@ -100,7 +100,7 @@ typedef struct DataFlash /** * Convert + ASSERT from generic KFile to DataFlash. */ -INLINE DataFlash * DATAFLASHKFILE(KFile *fd) +INLINE DataFlash * DATAFLASH(KFile *fd) { ASSERT(fd->_type == KFT_DATAFLASH); return (DataFlash *)fd; -- 2.25.1