From: asterix Date: Fri, 30 Jul 2010 16:05:58 +0000 (+0000) Subject: Add deprecared i2c api switch for eeprom. Silent warning. X-Git-Tag: 2.6.0~276 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;ds=sidebyside;h=c9ecb3e0d18109842811a56e9fa816e58d2beb7c;p=bertos.git Add deprecared i2c api switch for eeprom. Silent warning. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4114 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/drv/eeprom.c b/bertos/drv/eeprom.c index 52ab70c7..cc9b5292 100644 --- a/bertos/drv/eeprom.c +++ b/bertos/drv/eeprom.c @@ -26,7 +26,7 @@ * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * - * Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/) + * Copyright 2003, 2004, 2005, 2010 Develer S.r.l. (http://www.develer.com/) * * --> * @@ -38,6 +38,8 @@ #include "eeprom.h" +#include "cfg/cfg_i2c.h" + #include // MIN() #include #include // MOD_CHECK() @@ -103,6 +105,7 @@ static const EepromInfo mem_info[] = STATIC_ASSERT(countof(mem_info) == EEPROM_CNT); +#if !CONFIG_I2C_DISABLE_OLD_API /** * Copy \a size bytes from buffer \a buf to @@ -388,3 +391,5 @@ void eeprom_init(Eeprom *fd, EepromType type, e2dev_addr_t addr, bool verify) fd->fd.seek = kfile_genericSeek; } + +#endif /* !CONFIG_I2C_DISABLE_OLD_API */ diff --git a/bertos/drv/i2c.h b/bertos/drv/i2c.h index d934497b..56feb690 100644 --- a/bertos/drv/i2c.h +++ b/bertos/drv/i2c.h @@ -66,6 +66,7 @@ #if !CONFIG_I2C_DISABLE_OLD_API + /** * I2C Backends. * Sometimes your cpu does not have a builtin @@ -134,7 +135,8 @@ int i2c_bitbang_get(bool ack); bool i2c_send(const void *_buf, size_t count); bool i2c_recv(void *_buf, size_t count); -#endif +#endif /* !CONFIG_I2C_DISABLE_OLD_API */ + /* * I2c new api diff --git a/bertos/drv/i2c_bitbang.c b/bertos/drv/i2c_bitbang.c index 2f2b7e00..8d93e1b1 100644 --- a/bertos/drv/i2c_bitbang.c +++ b/bertos/drv/i2c_bitbang.c @@ -334,7 +334,7 @@ void i2c_hw_bitbangInit(I2c *i2c, int dev) i2c->hw = (struct I2cHardware *)(dev - I2C_BITBANG0); i2c->vt = &i2c_bitbang_vt; - i2c_bitbang_init(I2C_DEV(i2c)); + i2c_bitbangInit(I2C_DEV(i2c)); i2c_sdaHi(I2C_DEV(i2c)); i2c_sclHi(I2C_DEV(i2c)); } diff --git a/bertos/hw/hw_i2c_bitbang.h b/bertos/hw/hw_i2c_bitbang.h index 16cb5e53..6aabb46d 100644 --- a/bertos/hw/hw_i2c_bitbang.h +++ b/bertos/hw/hw_i2c_bitbang.h @@ -118,7 +118,7 @@ INLINE void i2c_halfbitDelay(int dev) /** * This macro should set SDA and SCL lines as input. */ -INLINE void i2c_bitbang_init(int dev) +INLINE void i2c_bitbangInit(int dev) { (void)(dev); /* Implement me! */