From b874475dd7bd457edbe12b5965ba06a809965b5c Mon Sep 17 00:00:00 2001 From: utzig Date: Thu, 27 Jun 2013 15:19:20 +0000 Subject: [PATCH] Make AVR I2C config naming more standard git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5901 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-AT90CANx-GCC/mcuconf.h | 2 +- demos/AVR-ATmega128-GCC/mcuconf.h | 2 +- demos/AVR-Arduino-GCC/mcuconf.h | 2 +- demos/AVR-ArduinoMega-GCC/mcuconf.h | 2 +- os/hal/platforms/AVR/i2c_lld.c | 12 ++++++------ os/hal/platforms/AVR/i2c_lld.h | 8 ++++---- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/demos/AVR-AT90CANx-GCC/mcuconf.h b/demos/AVR-AT90CANx-GCC/mcuconf.h index 80ad52283..7aa30ad32 100644 --- a/demos/AVR-AT90CANx-GCC/mcuconf.h +++ b/demos/AVR-AT90CANx-GCC/mcuconf.h @@ -48,7 +48,7 @@ /* * I2C driver system settings. */ -#define USE_AVR_I2C FALSE +#define AVR_I2C_USE_I2C1 FALSE /* * SPI driver system settings. diff --git a/demos/AVR-ATmega128-GCC/mcuconf.h b/demos/AVR-ATmega128-GCC/mcuconf.h index 788c7a473..324639526 100644 --- a/demos/AVR-ATmega128-GCC/mcuconf.h +++ b/demos/AVR-ATmega128-GCC/mcuconf.h @@ -48,7 +48,7 @@ /* * I2C driver system settings. */ -#define USE_AVR_I2C FALSE +#define AVR_I2C_USE_I2C1 FALSE /* * SPI driver system settings. diff --git a/demos/AVR-Arduino-GCC/mcuconf.h b/demos/AVR-Arduino-GCC/mcuconf.h index 80ad52283..7aa30ad32 100644 --- a/demos/AVR-Arduino-GCC/mcuconf.h +++ b/demos/AVR-Arduino-GCC/mcuconf.h @@ -48,7 +48,7 @@ /* * I2C driver system settings. */ -#define USE_AVR_I2C FALSE +#define AVR_I2C_USE_I2C1 FALSE /* * SPI driver system settings. diff --git a/demos/AVR-ArduinoMega-GCC/mcuconf.h b/demos/AVR-ArduinoMega-GCC/mcuconf.h index 80ad52283..7aa30ad32 100644 --- a/demos/AVR-ArduinoMega-GCC/mcuconf.h +++ b/demos/AVR-ArduinoMega-GCC/mcuconf.h @@ -48,7 +48,7 @@ /* * I2C driver system settings. */ -#define USE_AVR_I2C FALSE +#define AVR_I2C_USE_I2C1 FALSE /* * SPI driver system settings. diff --git a/os/hal/platforms/AVR/i2c_lld.c b/os/hal/platforms/AVR/i2c_lld.c index 8db158fbd..b22a6c8b0 100644 --- a/os/hal/platforms/AVR/i2c_lld.c +++ b/os/hal/platforms/AVR/i2c_lld.c @@ -36,8 +36,8 @@ /*===========================================================================*/ /** @brief I2C driver identifier.*/ -#if USE_AVR_I2C || defined(__DOXYGEN__) -I2CDriver I2CD; +#if AVR_I2C_USE_I2C1 || defined(__DOXYGEN__) +I2CDriver I2CD1; #endif /*===========================================================================*/ @@ -71,7 +71,7 @@ I2CDriver I2CD; /* Driver interrupt handlers. */ /*===========================================================================*/ -#if USE_AVR_I2C || defined(__DOXYGEN__) +#if AVR_I2C_USE_I2C1 || defined(__DOXYGEN__) /** * @brief I2C event interrupt handler. * @@ -80,7 +80,7 @@ I2CDriver I2CD; CH_IRQ_HANDLER(TWI_vect) { CH_IRQ_PROLOGUE(); - I2CDriver *i2cp = &I2CD; + I2CDriver *i2cp = &I2CD1; switch (TWSR & 0xF8) { case TWI_START: @@ -148,7 +148,7 @@ CH_IRQ_HANDLER(TWI_vect) { CH_IRQ_EPILOGUE(); } -#endif /* USE_AVR_I2C */ +#endif /* AVR_I2C_USE_I2C1 */ /*===========================================================================*/ /* Driver exported functions. */ @@ -160,7 +160,7 @@ CH_IRQ_HANDLER(TWI_vect) { * @notapi */ void i2c_lld_init(void) { - i2cObjectInit(&I2CD); + i2cObjectInit(&I2CD1); } /** diff --git a/os/hal/platforms/AVR/i2c_lld.h b/os/hal/platforms/AVR/i2c_lld.h index 9e49cefbe..3e125d9b8 100644 --- a/os/hal/platforms/AVR/i2c_lld.h +++ b/os/hal/platforms/AVR/i2c_lld.h @@ -71,8 +71,8 @@ * @details If set to @p TRUE the support for I2C is included. * @note The default is @p FALSE. */ -#if !defined(USE_AVR_I2C) || defined(__DOXYGEN__) -#define USE_AVR_I2C FALSE +#if !defined(AVR_I2C_USE_I2C1) || defined(__DOXYGEN__) +#define AVR_I2C_USE_I2C1 FALSE #endif /** @} */ @@ -195,8 +195,8 @@ typedef struct I2CDriver I2CDriver; /*===========================================================================*/ #if !defined(__DOXYGEN__) -#if USE_AVR_I2C -extern I2CDriver I2CD; +#if AVR_I2C_USE_I2C1 +extern I2CDriver I2CD1; #endif #endif /* !defined(__DOXYGEN__) */