From 978b233c04d78c163407605edf4d01a7a822cb55 Mon Sep 17 00:00:00 2001 From: Theodore Ateba Date: Sat, 2 Sep 2017 14:15:45 +0000 Subject: Correct the I2C driver code style and comment. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10534 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/AVR/MEGA/LLD/I2Cv1/hal_i2c_lld.c | 9 +++++++-- os/hal/ports/AVR/MEGA/LLD/I2Cv1/hal_i2c_lld.h | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'os/hal/ports/AVR/MEGA') diff --git a/os/hal/ports/AVR/MEGA/LLD/I2Cv1/hal_i2c_lld.c b/os/hal/ports/AVR/MEGA/LLD/I2Cv1/hal_i2c_lld.c index bf253f25e..989cf5e6d 100644 --- a/os/hal/ports/AVR/MEGA/LLD/I2Cv1/hal_i2c_lld.c +++ b/os/hal/ports/AVR/MEGA/LLD/I2Cv1/hal_i2c_lld.c @@ -15,8 +15,8 @@ */ /** - * @file hal_i2c_lld.c - * @brief AVR I2C subsystem low level driver source. + * @file I2Cv1/hal_i2c_lld.c + * @brief AVR/MEGA I2C subsystem low level driver source. * * @addtogroup I2C * @{ @@ -144,6 +144,7 @@ OSAL_IRQ_HANDLER(TWI_vect) { * @notapi */ void i2c_lld_init(void) { + i2cObjectInit(&I2CD1); I2CD1.thread = NULL; } @@ -156,6 +157,7 @@ void i2c_lld_init(void) { * @notapi */ void i2c_lld_start(I2CDriver *i2cp) { + uint32_t clock_speed = 100000; /* TODO: Test TWI without external pull-ups (use internal) */ @@ -209,6 +211,7 @@ void i2c_lld_stop(I2CDriver *i2cp) { msg_t i2c_lld_master_receive_timeout(I2CDriver *i2cp, i2caddr_t addr, uint8_t *rxbuf, size_t rxbytes, systime_t timeout) { + i2cp->errors = I2C_NO_ERROR; i2cp->addr = addr; i2cp->txbuf = NULL; @@ -251,6 +254,7 @@ msg_t i2c_lld_master_transmit_timeout(I2CDriver *i2cp, i2caddr_t addr, const uint8_t *txbuf, size_t txbytes, uint8_t *rxbuf, size_t rxbytes, systime_t timeout) { + i2cp->errors = I2C_NO_ERROR; i2cp->addr = addr; i2cp->txbuf = txbuf; @@ -268,3 +272,4 @@ msg_t i2c_lld_master_transmit_timeout(I2CDriver *i2cp, i2caddr_t addr, #endif /* HAL_USE_I2C */ /** @} */ + diff --git a/os/hal/ports/AVR/MEGA/LLD/I2Cv1/hal_i2c_lld.h b/os/hal/ports/AVR/MEGA/LLD/I2Cv1/hal_i2c_lld.h index b939a790b..6822abca7 100644 --- a/os/hal/ports/AVR/MEGA/LLD/I2Cv1/hal_i2c_lld.h +++ b/os/hal/ports/AVR/MEGA/LLD/I2Cv1/hal_i2c_lld.h @@ -15,8 +15,8 @@ */ /** - * @file hal_i2c_lld.h - * @brief AVR I2C subsystem low level driver header. + * @file I2Cv1/hal_i2c_lld.h + * @brief AVR/MEGA I2C subsystem low level driver header. * * @addtogroup I2C * @{ -- cgit v1.2.3