Correction of AVR hal_i2c_lld to respect the project code style.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10020 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
tfateba 2017-01-04 20:34:47 +00:00
parent 1bfb237b48
commit 6a0f53a89e
3 changed files with 36 additions and 32 deletions

View File

@ -20,7 +20,7 @@
*/
/**
* @file AVR/gpt_lld.h
* @file hal_gpt_lld.h
* @brief AVR GPT driver subsystem low level driver.
*
* @addtogroup GPT

View File

@ -15,7 +15,7 @@
*/
/**
* @file AVR/i2c_lld.c
* @file hal_i2c_lld.c
* @brief AVR I2C subsystem low level driver source.
*
* @addtogroup I2C
@ -76,10 +76,12 @@ OSAL_IRQ_HANDLER(TWI_vect) {
if (i2cp->txidx < i2cp->txbytes) {
TWDR = i2cp->txbuf[i2cp->txidx++];
TWCR = ((1 << TWINT) | (1 << TWEN) | (1 << TWIE));
} else {
}
else {
if (i2cp->rxbuf && i2cp->rxbytes) {
TWCR = ((1 << TWSTA) | (1 << TWINT) | (1 << TWEN) | (1 << TWIE));
} else {
}
else {
TWCR = ((1 << TWSTO) | (1 << TWINT) | (1 << TWEN));
_i2c_wakeup_isr(i2cp);
}
@ -88,7 +90,8 @@ OSAL_IRQ_HANDLER(TWI_vect) {
case TWI_MASTER_RX_ADDR_ACK:
if (i2cp->rxidx == (i2cp->rxbytes - 1)) {
TWCR = ((1 << TWINT) | (1 << TWEN) | (1 << TWIE));
} else {
}
else {
TWCR = ((1 << TWEA) | (1 << TWINT) | (1 << TWEN) | (1 << TWIE));
}
break;
@ -96,7 +99,8 @@ OSAL_IRQ_HANDLER(TWI_vect) {
i2cp->rxbuf[i2cp->rxidx++] = TWDR;
if (i2cp->rxidx == (i2cp->rxbytes - 1)) {
TWCR = ((1 << TWINT) | (1 << TWEN) | (1 << TWIE));
} else {
}
else {
TWCR = ((1 << TWEA) | (1 << TWINT) | (1 << TWEN) | (1 << TWIE));
}
break;
@ -191,7 +195,7 @@ void i2c_lld_stop(I2CDriver *i2cp) {
* @param[in] timeout the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_INFINITE no timeout.
* .
*
* @return The operation status.
* @retval MSG_OK if the function succeeded.
* @retval MSG_RESET if one or more I2C errors occurred, the errors can
@ -232,7 +236,7 @@ msg_t i2c_lld_master_receive_timeout(I2CDriver *i2cp, i2caddr_t addr,
* @param[in] timeout the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_INFINITE no timeout.
* .
*
* @return The operation status.
* @retval MSG_OK if the function succeeded.
* @retval MSG_RESET if one or more I2C errors occurred, the errors can

View File

@ -15,7 +15,7 @@
*/
/**
* @file AVR/i2c_lld.h
* @file hal_i2c_lld.h
* @brief AVR I2C subsystem low level driver header.
*
* @addtogroup I2C