cc2538: lpm: Let system clock transitions complete before further changes
As a matter of precaution, always make sure that pending system clock transitions are complete before requesting a new change of the system clock source. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
This commit is contained in:
parent
8514a91ea9
commit
13006e1c73
@ -158,6 +158,9 @@ enter_pm0(void)
|
|||||||
static void
|
static void
|
||||||
select_32_mhz_xosc(void)
|
select_32_mhz_xosc(void)
|
||||||
{
|
{
|
||||||
|
/*First, make sure there is no ongoing clock source change */
|
||||||
|
while((REG(SYS_CTRL_CLOCK_STA) & SYS_CTRL_CLOCK_STA_SOURCE_CHANGE) != 0);
|
||||||
|
|
||||||
/* Turn on the 32 MHz XOSC and source the system clock on it. */
|
/* Turn on the 32 MHz XOSC and source the system clock on it. */
|
||||||
REG(SYS_CTRL_CLOCK_CTRL) &= ~SYS_CTRL_CLOCK_CTRL_OSC;
|
REG(SYS_CTRL_CLOCK_CTRL) &= ~SYS_CTRL_CLOCK_CTRL_OSC;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user