1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 07:21:18 +01:00

cpu/sam0_common/i2c: fix ambiguous reg assignment

The value assigned to the register was unclear due to usage
    of bit-comparison and ternary operator, added parentheses to
    make it explicit.
This commit is contained in:
smlng 2018-07-12 11:16:58 +02:00 committed by dylad
parent 8964f3accc
commit 90f66a1952

View File

@ -127,8 +127,8 @@ void i2c_init(i2c_t dev)
/* Set sercom module to operate in I2C master mode and run in Standby
if user requests it */
bus(dev)->CTRLA.reg = SERCOM_I2CM_CTRLA_MODE_I2C_MASTER |
(i2c_config[dev].flags & I2C_FLAG_RUN_STANDBY ?
SERCOM_I2CM_CTRLA_RUNSTDBY : 0);
((i2c_config[dev].flags & I2C_FLAG_RUN_STANDBY) ?
SERCOM_I2CM_CTRLA_RUNSTDBY : 0);
/* Enable Smart Mode (ACK is sent when DATA.DATA is read) */
bus(dev)->CTRLB.reg = SERCOM_I2CM_CTRLB_SMEN;