Quantcast
Channel: Embedded Software (Read Only)
Viewing all articles
Browse latest Browse all 25965

Forum Post: demo/pmic.c: bad DEVCTRL value masking

$
0
0

Hi,

The following code snippet in selectI2CInstance in demo/pmic.c for evmAM335x and evmskAM335x is wrong:

/* Modify reg value */
i2cInstance = (dataFromSlave[I2C_0][0] & PMIC_DEVCTRL_REG_SR_CTL_I2C_SEL) |
              (i2cInstance << PMIC_DEVCTRL_REG_SR_CTL_I2C_SEL_SHIFT);

It should be AND'ing with the inverted bitmask, like so:

& (~PMIC_DEVCTRL_REG_SR_CTL_I2C_SEL)

the same way it's done in bl_platform.c.

Thanks,

Orjan


Viewing all articles
Browse latest Browse all 25965

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>