Skip to content

Commit 8d7ee67

Browse files
authored
fix(Examples): Fix RTC_BACKUP Example for MAX32690 not printing the time to console (#1571)
Signed-off-by: dnguye14-adi <dung.nguyen@analog.com>
1 parent 0add3f4 commit 8d7ee67

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

  • Examples/MAX32690/RTC_Backup

Examples/MAX32690/RTC_Backup/main.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
44
* Analog Devices, Inc.),
5-
* Copyright (C) 2023-2024 Analog Devices, Inc.
5+
* Copyright (C) 2023-2026 Analog Devices, Inc.
66
*
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
@@ -149,15 +149,18 @@ int configureRTC(void)
149149
// *****************************************************************************
150150
int main(void)
151151
{
152-
if (MXC_PWRSEQ->lppwst !=
153-
MXC_F_PWRSEQ_LPPWST_BACKUP) { // Check whether the wakeup source is RTC
154-
if (configureRTC() != E_NO_ERROR) { // System start/restart
152+
// Check whether the wakeup source is RTC
153+
if ((MXC_PWRSEQ->lppwst & MXC_F_PWRSEQ_LPPWST_RESET) != 0) { // System start/restart
154+
if (configureRTC() != E_NO_ERROR) {
155155
printf("Example Failed\n");
156156
while (1) {}
157157
}
158-
} else {
158+
} else if ((MXC_PWRSEQ->lppwst & MXC_F_PWRSEQ_LPPWST_BACKUP) != 0) { // Wakes up from BACKUP
159159
LED_On(LED_TODA); // RTC alarm fired off. Perform periodic task here
160160
printTime();
161+
} else {
162+
printf("Example Failed\n");
163+
while (1) {}
161164
}
162165

163166
rescheduleAlarm(); // Re-arm RTC TOD alarm

0 commit comments

Comments
 (0)