Skip to content

Commit bd3f99f

Browse files
Edmund Hsubulislaw
authored andcommitted
Preserve RTC counter value while re-initialization
1 parent 347644d commit bd3f99f

File tree

2 files changed

+12
-10
lines changed
  • targets/TARGET_Analog_Devices
    • TARGET_ADUCM302X/TARGET_ADUCM3029/bsp/rtc
    • TARGET_ADUCM4X50/TARGET_ADUCM4050/bsp/rtc

2 files changed

+12
-10
lines changed

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/bsp/rtc/adi_rtc.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @date: $Date: 2016-07-26 13:09:22 -0400 (Tue, 26 Jul 2016) $
77
*----------------------------------------------------------------------------
88
*
9-
Copyright (c) 2010-2016 Analog Devices, Inc.
9+
Copyright (c) 2010-2018 Analog Devices, Inc.
1010
1111
All rights reserved.
1212
@@ -304,18 +304,19 @@ ADI_RTC_RESULT adi_rtc_Open(
304304

305305
pDevice->pRTCRegs->SR0 = ADI_RTC_SR3_IRQ_STATUS_MASK;
306306
SYNC_AFTER_WRITE(SR0,BITM_RTC_SR0_WSYNCSR0)
307-
307+
/* Preserve RTC counter value while re-initialization
308308
pDevice->pRTCRegs->CNT0 = 0u;
309309
pDevice->pRTCRegs->CNT1 = 0u;
310310
SYNC_AFTER_WRITE(SR0,BITM_RTC_SR0_WSYNCCNT0)
311-
311+
*/
312312
/* local pointer to instance data */
313313
aRTCDeviceInfo[DeviceNumber].hDevice = pDevice;
314314
pDevice->pDeviceInfo = &aRTCDeviceInfo[DeviceNumber];
315315

316-
/* Use static configuration to initialize the RTC */
316+
/* Do not use static configuration to
317+
preserve RTC counter value while re-initialization
317318
rtc_init(pDevice,&aRTCConfig[DeviceNumber]);
318-
319+
*/
319320
/* store handle at application handle pointer */
320321
*phDevice = pDevice;
321322
pDevice->eIRQn = aRTCDeviceInfo[DeviceNumber].eIRQn;

targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/bsp/rtc/adi_rtc.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @date: $Date: 2016-07-26 13:09:22 -0400 (Tue, 26 Jul 2016) $
77
*----------------------------------------------------------------------------
88
*
9-
Copyright (c) 2010-2016 Analog Devices, Inc.
9+
Copyright (c) 2010-2018 Analog Devices, Inc.
1010
1111
All rights reserved.
1212
@@ -218,18 +218,19 @@ ADI_RTC_RESULT adi_rtc_Open(
218218

219219
pDevice->pRTCRegs->SR0 = ADI_RTC_SR3_IRQ_STATUS_MASK;
220220
SYNC_AFTER_WRITE(SR0,BITM_RTC_SR0_WSYNCSR0)
221-
221+
/* Preserve RTC counter value while re-initialization
222222
pDevice->pRTCRegs->CNT0 = 0u;
223223
pDevice->pRTCRegs->CNT1 = 0u;
224224
SYNC_AFTER_WRITE(SR0,BITM_RTC_SR0_WSYNCCNT0)
225-
225+
*/
226226
/* local pointer to instance data */
227227
aRTCDeviceInfo[DeviceNumber].hDevice = pDevice;
228228
pDevice->pDeviceInfo = &aRTCDeviceInfo[DeviceNumber];
229229

230-
/* Use static configuration to initialize the RTC */
230+
/* Do not use static configuration to
231+
preserve RTC counter value while re-initialization
231232
rtc_init(pDevice,&aRTCConfig[DeviceNumber]);
232-
233+
*/
233234
/* store handle at application handle pointer */
234235
*phDevice = pDevice;
235236
pDevice->eIRQn = aRTCDeviceInfo[DeviceNumber].eIRQn;

0 commit comments

Comments
 (0)