From d3e15bccfc41af4e4d3972003ff06b69de2225bc Mon Sep 17 00:00:00 2001 From: barthess Date: Mon, 12 Sep 2011 15:50:35 +0000 Subject: I2C. Revert const qualifier to the pointer to I2CSlaveConfig. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3310 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/i2c.h | 9 +++++---- os/hal/platforms/STM32/i2c_lld.c | 2 +- os/hal/platforms/STM32/i2c_lld.h | 2 +- os/hal/src/i2c.c | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/os/hal/include/i2c.h b/os/hal/include/i2c.h index 95bbfa8b4..acf09ec9c 100644 --- a/os/hal/include/i2c.h +++ b/os/hal/include/i2c.h @@ -105,7 +105,7 @@ typedef enum { * @param[in] i2cscfg pointer to the @p I2CSlaveConfig object triggering the * callback */ -typedef void (*i2ccallback_t)(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg); +typedef void (*i2ccallback_t)(I2CDriver *i2cp, const I2CSlaveConfig *i2cscfg); /** @@ -116,7 +116,8 @@ typedef void (*i2ccallback_t)(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg); * @param[in] i2cscfg pointer to the @p I2CSlaveConfig object triggering the * callback */ -typedef void (*i2cerrorcallback_t)(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg); +typedef void (*i2cerrorcallback_t)(I2CDriver *i2cp, + const I2CSlaveConfig *i2cscfg); /** @@ -255,11 +256,11 @@ extern "C" { void i2cObjectInit(I2CDriver *i2cp); void i2cStart(I2CDriver *i2cp, const I2CConfig *config); void i2cStop(I2CDriver *i2cp); - void i2cMasterTransmit(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg, + void i2cMasterTransmit(I2CDriver *i2cp, const I2CSlaveConfig *i2cscfg, uint16_t slave_addr, uint8_t *txbuf, size_t txbytes, uint8_t *rxbuf, size_t rxbytes); - void i2cMasterReceive(I2CDriver *i2cp, I2CSlaveConfig *i2cscfg, + void i2cMasterReceive(I2CDriver *i2cp, const I2CSlaveConfig *i2cscfg, uint16_t slave_addr, uint8_t *rxbuf, size_t rxbytes); void i2cMasterStart(I2CDriver *i2cp); void i2cMasterStop(I2CDriver *i2cp); diff --git a/os/hal/platforms/STM32/i2c_lld.c b/os/hal/platforms/STM32/i2c_lld.c index 48bdb3e4e..202669f8e 100644 --- a/os/hal/platforms/STM32/i2c_lld.c +++ b/os/hal/platforms/STM32/i2c_lld.c @@ -40,7 +40,7 @@ * Note: * When the STOP, START or PEC bit is set, the software must NOT perform * any write access to I2C_CR1 before this bit is cleared by hardware. - * Otherwise there is a risk of setting a second STOP, START or PEC request. + * Otherwise there is a risk of setting a second STOP, START or PEC request. */ /*===========================================================================*/ diff --git a/os/hal/platforms/STM32/i2c_lld.h b/os/hal/platforms/STM32/i2c_lld.h index aa11bb543..548b5418e 100644 --- a/os/hal/platforms/STM32/i2c_lld.h +++ b/os/hal/platforms/STM32/i2c_lld.h @@ -212,7 +212,7 @@ struct I2CDriver{ /** * @brief Current slave configuration data. */ - I2CSlaveConfig *id_slave_config; + const I2CSlaveConfig *id_slave_config; __IO size_t txbytes; /*!< @brief Number of bytes to be transmitted. */ __IO size_t rxbytes; /*!< @brief Number of bytes to be received. */ diff --git a/os/hal/src/i2c.c b/os/hal/src/i2c.c index 68735b037..9ce2cc76f 100644 --- a/os/hal/src/i2c.c +++ b/os/hal/src/i2c.c @@ -166,7 +166,7 @@ void i2cStop(I2CDriver *i2cp) { * you want transmit only */ void i2cMasterTransmit(I2CDriver *i2cp, - I2CSlaveConfig *i2cscfg, + const I2CSlaveConfig *i2cscfg, uint16_t slave_addr, uint8_t *txbuf, size_t txbytes, @@ -210,7 +210,7 @@ void i2cMasterTransmit(I2CDriver *i2cp, * @param[in] rxbuf pointer to receive buffer */ void i2cMasterReceive(I2CDriver *i2cp, - I2CSlaveConfig *i2cscfg, + const I2CSlaveConfig *i2cscfg, uint16_t slave_addr, uint8_t *rxbuf, size_t rxbytes){ -- cgit v1.2.3