From 7ac28c82b174b0a2a6505dc3f285c33a682c0a65 Mon Sep 17 00:00:00 2001 From: Jean Pierre Dudey Date: Fri, 13 Mar 2020 01:27:35 -0500 Subject: [PATCH] cc26x0: enable serial domain only once Signed-off-by: Jean Pierre Dudey --- cpu/cc26x0/Makefile.dep | 2 ++ cpu/cc26x0/periph/i2c.c | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cpu/cc26x0/Makefile.dep b/cpu/cc26x0/Makefile.dep index a0a73e54fe..cb4d821401 100644 --- a/cpu/cc26x0/Makefile.dep +++ b/cpu/cc26x0/Makefile.dep @@ -1 +1,3 @@ +USEMODULE += cc26xx_cc13xx + include ${RIOTCPU}/cc26xx_cc13xx/Makefile.dep diff --git a/cpu/cc26x0/periph/i2c.c b/cpu/cc26x0/periph/i2c.c index eea8dfdaa5..5b7ffaaa29 100644 --- a/cpu/cc26x0/periph/i2c.c +++ b/cpu/cc26x0/periph/i2c.c @@ -95,13 +95,13 @@ void i2c_init(i2c_t devnum) assert(devnum < I2C_NUMOF); /* Make sure everything is shut off in case of reinit */ - PRCM->PDCTL0SERIAL = 0; I2C->MCR = 0; PRCM->I2CCLKGR = 0; - /* enable SERIAL power domain */ - PRCM->PDCTL0SERIAL = 1; - while (!(PRCM->PDSTAT0 & PDSTAT0_SERIAL_ON)) {} + /* Enable serial power domain */ + if (!power_is_domain_enabled(POWER_DOMAIN_SERIAL)) { + power_enable_domain(POWER_DOMAIN_SERIAL); + } /* enable i2c clock in run mode */ PRCM->I2CCLKGR = 1;