File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
examples/advancedRTCAlarm Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,12 @@ volatile int alarmBMatch_counter = 0;
3030#endif
3131
3232/* Change this value to set alarm match offset in millisecond */
33- /* Note that STM32F1xx does not manage subsecond only second */
33+ /* Note that only mcu with RTC_SSR_SS defined managed subsecond else only second */
34+ #if defined(RTC_SSR_SS)
3435static uint32_t atime = 678 ;
35-
36+ #else
37+ static uint32_t atime = 1000 ;
38+ #endif
3639/* Change these values to set the current initial time */
3740const byte seconds = 0 ;
3841const byte minutes = 0 ;
@@ -83,14 +86,10 @@ void alarmMatch(void *data)
8386
8487 if (data != NULL ) {
8588 _millis = *(uint32_t *)data;
86- // Minimum is 1 second
87- if (sec == 0 ) {
88- sec = 1 ;
89- }
9089 }
9190
9291 sec = _millis / 1000 ;
93- #ifdef STM32F1xx
92+ #if !defined(RTC_SSR_SS)
9493 // Minimum is 1 second
9594 if (sec == 0 ) {
9695 sec = 1 ;
You can’t perform that action at this time.
0 commit comments