From cd17b68ae24fbf6fecf69a3f0b4fe8a1dfe5366c Mon Sep 17 00:00:00 2001 From: batt Date: Mon, 8 Sep 2008 14:01:50 +0000 Subject: [PATCH] Rename macros. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1800 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/drv/eeprom.c | 6 +++--- bertos/drv/eeprom.h | 2 +- bertos/drv/ft245rl.c | 4 ++-- bertos/drv/ft245rl.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bertos/drv/eeprom.c b/bertos/drv/eeprom.c index ceca24d2..92ddac73 100644 --- a/bertos/drv/eeprom.c +++ b/bertos/drv/eeprom.c @@ -102,7 +102,7 @@ STATIC_ASSERT(countof(mem_info) == EEPROM_CNT); */ 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; @@ -175,7 +175,7 @@ static size_t eeprom_writeRaw(struct KFile *_fd, const void *buf, size_t size) */ 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; @@ -204,7 +204,7 @@ static size_t eeprom_writeVerify(struct KFile *_fd, const void *_buf, size_t siz */ 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; diff --git a/bertos/drv/eeprom.h b/bertos/drv/eeprom.h index 15c56553..60ef1569 100644 --- a/bertos/drv/eeprom.h +++ b/bertos/drv/eeprom.h @@ -83,7 +83,7 @@ typedef struct Eeprom /** * Convert + ASSERT from generic KFile to Eeprom. */ -INLINE Eeprom * EEPROM(KFile *fd) +INLINE Eeprom * EEPROM_CAST(KFile *fd) { ASSERT(fd->_type == KFT_EEPROM); return (Eeprom *)fd; diff --git a/bertos/drv/ft245rl.c b/bertos/drv/ft245rl.c index 40ffe0fd..9afe7647 100644 --- a/bertos/drv/ft245rl.c +++ b/bertos/drv/ft245rl.c @@ -59,7 +59,7 @@ MOD_DEFINE(ft245rl); */ static size_t ft245rl_read(struct KFile *_fd, void *_buf, size_t size) { - Ft245rl *fd = FT245RL(_fd); + Ft245rl *fd = FT245RL_CAST(_fd); (void)fd; //unused uint8_t *buf = (uint8_t *)_buf; size_t total_read = 0; @@ -81,7 +81,7 @@ static size_t ft245rl_read(struct KFile *_fd, void *_buf, size_t size) */ static size_t ft245rl_write(struct KFile *_fd, const void *_buf, size_t size) { - Ft245rl *fd = FT245RL(_fd); + Ft245rl *fd = FT245RL_CAST(_fd); (void)fd; //unused const uint8_t *buf = (const uint8_t *)_buf; size_t total_write = 0; diff --git a/bertos/drv/ft245rl.h b/bertos/drv/ft245rl.h index e120ab9c..a4a8dcae 100644 --- a/bertos/drv/ft245rl.h +++ b/bertos/drv/ft245rl.h @@ -61,7 +61,7 @@ typedef struct Ft245rl /** * Convert + ASSERT from generic KFile to KFileFt245rl. */ -INLINE Ft245rl * FT245RL(KFile *fd) +INLINE Ft245rl * FT245RL_CAST(KFile *fd) { ASSERT(fd->_type == KFT_FT245RL); return (Ft245rl *)fd; -- 2.25.1