cc26x0: enable serial domain only once

Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
This commit is contained in:
Jean Pierre Dudey 2020-03-13 01:27:35 -05:00
parent 4643ed5733
commit 7ac28c82b1
No known key found for this signature in database
GPG Key ID: 631A70D74E41F1AD
2 changed files with 6 additions and 4 deletions

View File

@ -1 +1,3 @@
USEMODULE += cc26xx_cc13xx
include ${RIOTCPU}/cc26xx_cc13xx/Makefile.dep include ${RIOTCPU}/cc26xx_cc13xx/Makefile.dep

View File

@ -95,13 +95,13 @@ void i2c_init(i2c_t devnum)
assert(devnum < I2C_NUMOF); assert(devnum < I2C_NUMOF);
/* Make sure everything is shut off in case of reinit */ /* Make sure everything is shut off in case of reinit */
PRCM->PDCTL0SERIAL = 0;
I2C->MCR = 0; I2C->MCR = 0;
PRCM->I2CCLKGR = 0; PRCM->I2CCLKGR = 0;
/* enable SERIAL power domain */ /* Enable serial power domain */
PRCM->PDCTL0SERIAL = 1; if (!power_is_domain_enabled(POWER_DOMAIN_SERIAL)) {
while (!(PRCM->PDSTAT0 & PDSTAT0_SERIAL_ON)) {} power_enable_domain(POWER_DOMAIN_SERIAL);
}
/* enable i2c clock in run mode */ /* enable i2c clock in run mode */
PRCM->I2CCLKGR = 1; PRCM->I2CCLKGR = 1;