Add deprecared i2c api switch for eeprom. Silent warning.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 30 Jul 2010 16:05:58 +0000 (16:05 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 30 Jul 2010 16:05:58 +0000 (16:05 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4114 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/drv/eeprom.c
bertos/drv/i2c.h
bertos/drv/i2c_bitbang.c
bertos/hw/hw_i2c_bitbang.h

index 52ab70c72f7ab5f1cf8232f1b66ec818212a9905..cc9b5292ba15c34af47822c37c6d61090149ecab 100644 (file)
@@ -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 <cfg/macros.h>  // MIN()
 #include <cfg/debug.h>
 #include <cfg/module.h>  // 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 */
index d934497bc684d470df6d0f572425c30d55130210..56feb6901dea6911816705b658b67c171d512063 100644 (file)
@@ -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
index 2f2b7e009123f9cdc3cb5b68c4a8d0288d7ce1f2..8d93e1b1187a5391e9352ed2fc7841e2cc6f708e 100644 (file)
@@ -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));
 }
index 16cb5e537c9ded9412be97f072755dc8e638e077..6aabb46d6a1bb063eaeff211f73b13631b1c1ba7 100644 (file)
@@ -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! */