diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-12-31 09:40:52 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-12-31 09:40:52 +0000 |
commit | 72266f8b591c6e7857f4578ba753eeea7222ac6b (patch) | |
tree | e4ee6aff373f4d05f12899170bb5942a826c8264 /os/hal/platforms | |
parent | b58117763064615d8d480f3c847ea3d41fe49b81 (diff) | |
download | ChibiOS-72266f8b591c6e7857f4578ba753eeea7222ac6b.tar.gz ChibiOS-72266f8b591c6e7857f4578ba753eeea7222ac6b.tar.bz2 ChibiOS-72266f8b591c6e7857f4578ba753eeea7222ac6b.zip |
I2C. Fixes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3694 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms')
-rw-r--r-- | os/hal/platforms/STM32/i2c_lld.c | 3 | ||||
-rw-r--r-- | os/hal/platforms/STM32/i2c_lld.h | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/os/hal/platforms/STM32/i2c_lld.c b/os/hal/platforms/STM32/i2c_lld.c index bfbaa410f..6ad501e04 100644 --- a/os/hal/platforms/STM32/i2c_lld.c +++ b/os/hal/platforms/STM32/i2c_lld.c @@ -563,7 +563,7 @@ msg_t i2c_lld_master_receive_timeout(I2CDriver *i2cp, * @retval RDY_TIMEOUT if a timeout occurred before operation end. */ msg_t i2c_lld_master_transmit_timeout(I2CDriver *i2cp, uint8_t slave_addr, - uint8_t *txbuf, size_t txbytes, + const uint8_t *txbuf, size_t txbytes, uint8_t *rxbuf, size_t rxbytes, systime_t timeout){ @@ -578,7 +578,6 @@ msg_t i2c_lld_master_transmit_timeout(I2CDriver *i2cp, uint8_t slave_addr, i2cp->slave_addr = (slave_addr << 1) & 0x00FE; /* LSB = 0 -> write */ i2cp->txbytes = txbytes; i2cp->rxbytes = rxbytes; - i2cp->txbuf = txbuf; i2cp->rxbuf = rxbuf; i2cp->errors = 0; diff --git a/os/hal/platforms/STM32/i2c_lld.h b/os/hal/platforms/STM32/i2c_lld.h index db0704066..5be23cba3 100644 --- a/os/hal/platforms/STM32/i2c_lld.h +++ b/os/hal/platforms/STM32/i2c_lld.h @@ -308,7 +308,6 @@ struct I2CDriver{ __IO size_t txbytes; /*!< @brief Number of bytes to be transmitted. */ __IO size_t rxbytes; /*!< @brief Number of bytes to be received. */ uint8_t *rxbuf; /*!< @brief Pointer to receive buffer. */ - uint8_t *txbuf; /*!< @brief Pointer to transmit buffer.*/ __IO i2cflags_t errors; /*!< @brief Error flags.*/ @@ -384,6 +383,7 @@ struct I2CDriver{ Thread *tp = (i2cp)->id_thread; \ (i2cp)->id_thread = NULL; \ chSysLockFromIsr(); \ + tp->p_u.rdymsg = RDY_RESET; \ chSchReadyI(tp); \ chSysUnlockFromIsr(); \ } \ @@ -448,7 +448,7 @@ void i2c_lld_set_opmode(I2CDriver *i2cp); void i2c_lld_start(I2CDriver *i2cp); void i2c_lld_stop(I2CDriver *i2cp); msg_t i2c_lld_master_transmit_timeout(I2CDriver *i2cp, uint8_t slave_addr, - uint8_t *txbuf, size_t txbytes, + const uint8_t *txbuf, size_t txbytes, uint8_t *rxbuf, size_t rxbytes, systime_t timeout); msg_t i2c_lld_master_receive_timeout(I2CDriver *i2cp, |