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;
30
30
#endif
31
31
32
32
/* 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)
34
35
static uint32_t atime = 678 ;
35
-
36
+ #else
37
+ static uint32_t atime = 1000 ;
38
+ #endif
36
39
/* Change these values to set the current initial time */
37
40
const byte seconds = 0 ;
38
41
const byte minutes = 0 ;
@@ -83,14 +86,10 @@ void alarmMatch(void *data)
83
86
84
87
if (data != NULL ) {
85
88
_millis = *(uint32_t *)data;
86
- // Minimum is 1 second
87
- if (sec == 0 ) {
88
- sec = 1 ;
89
- }
90
89
}
91
90
92
91
sec = _millis / 1000 ;
93
- #ifdef STM32F1xx
92
+ #if !defined(RTC_SSR_SS)
94
93
// Minimum is 1 second
95
94
if (sec == 0 ) {
96
95
sec = 1 ;
You can’t perform that action at this time.
0 commit comments