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:
parent
8964f3accc
commit
90f66a1952
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user