Skip to content

Commit e59b3d8

Browse files
authored
Merge pull request ARMmbed#91 from linlingao/fix_rtc_init
Fixed a bug in soft reset where RTC is not enabled after soft reset
2 parents e728737 + 61daa1d commit e59b3d8

File tree

2 files changed

+6
-5
lines changed
  • targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF

2 files changed

+6
-5
lines changed

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/rtc_api.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ void rtc_init(void) {
2424
static bool rtc_initialized = false;
2525
if (!rtc_initialized)
2626
{
27-
PRCMRTCInUseSet();
27+
if (!PRCMRTCInUseGet)
28+
{
29+
PRCMRTCInUseSet();
30+
}
2831
rtc_initialized = true;
2932
}
3033
}

targets/TARGET_TI/TARGET_CC32XX/TARGET_CC3220SF/ti/devices/cc32xx/driverlib/prcm.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,10 +1988,8 @@ void PRCMCC3200MCUInit()
19881988
//
19891989
// Enable RTC
19901990
//
1991-
if(PRCMSysResetCauseGet()== PRCM_POWER_ON)
1992-
{
1993-
PRCMHIBRegWrite(0x4402F804,0x1);
1994-
}
1991+
1992+
PRCMHIBRegWrite(0x4402F804,0x1);
19951993

19961994
//
19971995
// Enable Timers

0 commit comments

Comments
 (0)