File tree Expand file tree Collapse file tree
Examples/MAX32690/RTC_Backup Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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// *****************************************************************************
150150int 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
You can’t perform that action at this time.
0 commit comments