From: asterix Date: Fri, 30 Jul 2010 14:49:13 +0000 (+0000) Subject: Use macro to define i2c generic init. X-Git-Tag: 2.6.0~285 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=29c4855f4c1a1fd98f6b7185b8f4494d35389dca;p=bertos.git Use macro to define i2c generic init. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4105 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/drv/i2c.h b/bertos/drv/i2c.h index f0a3ec0d..7ce15306 100644 --- a/bertos/drv/i2c.h +++ b/bertos/drv/i2c.h @@ -321,12 +321,7 @@ INLINE int i2c_error(I2c *i2c) return err; } -INLINE void i2c_init_3(I2c *i2c, int dev, uint32_t clock) -{ - if (dev > I2C_BITBANG0) - i2c_hw_bitbangInit(i2c, dev); - else - i2c_hw_init(i2c, dev, clock); -} +#define i2c_init_3(i2c, dev, clock) (dev > I2C_BITBANG0) ? i2c_hw_bitbangInit(i2c, dev) : i2c_hw_init(i2c, dev, clock) + #endif