@@ -51,8 +51,8 @@ static byte day = 0;
5151static byte month = 0 ;
5252static byte year = 0 ;
5353
54- static STM32RTC::RTC_Hour_Format hourFormat = STM32RTC::RTC_HOUR_24 ;
55- static STM32RTC::RTC_AM_PM period = STM32RTC::RTC_AM ;
54+ static STM32RTC::Hour_Format hourFormat = STM32RTC::HOUR_24 ;
55+ static STM32RTC::AM_PM period = STM32RTC::AM ;
5656
5757#ifndef STM32F1xx
5858static STM32RTC::Alarm_Match SS_MATCH = STM32RTC::MATCH_SS;
@@ -70,13 +70,13 @@ void setup()
7070void loop ()
7171{
7272 int c; // Serial input
73- STM32RTC::RTC_Source_Clock clkSource = rtc.RTC_LSI_CLOCK ;
73+ STM32RTC::Source_Clock clkSource = rtc.LSI_CLOCK ;
7474
75- // Select RTC clock source: RTC_LSI_CLOCK, RTC_LSE_CLOCK or RTC_HSE_CLOCK .
75+ // Select RTC clock source: LSI_CLOCK, LSE_CLOCK or HSE_CLOCK .
7676 Serial.println (" Select clock Source:" );
77- Serial.println (" 1- RTC_LSI_CLOCK " );
78- Serial.println (" 2- RTC_LSE_CLOCK " );
79- Serial.println (" 3- RTC_HSE_CLOCK " );
77+ Serial.println (" 1- LSI_CLOCK " );
78+ Serial.println (" 2- LSE_CLOCK " );
79+ Serial.println (" 3- HSE_CLOCK " );
8080 Serial.println ();
8181 // get input
8282 while (1 ) {
@@ -91,16 +91,16 @@ void loop()
9191 switch (c) {
9292 case ' 1' :
9393 default :
94- Serial.println (" Test will use RTC_LSI_CLOCK " );
95- clkSource = rtc.RTC_LSI_CLOCK ;
94+ Serial.println (" Test will use LSI_CLOCK " );
95+ clkSource = rtc.LSI_CLOCK ;
9696 break ;
9797 case ' 2' :
98- Serial.println (" Test will use RTC_LSE_CLOCK " );
99- clkSource = rtc.RTC_LSE_CLOCK ;
98+ Serial.println (" Test will use LSE_CLOCK " );
99+ clkSource = rtc.LSE_CLOCK ;
100100 break ;
101101 case ' 3' :
102- Serial.println (" Test will use RTC_HSE_CLOCK " );
103- clkSource = rtc.RTC_HSE_CLOCK ;
102+ Serial.println (" Test will use HSE_CLOCK " );
103+ clkSource = rtc.HSE_CLOCK ;
104104 break ;
105105 }
106106 break ;
@@ -112,46 +112,46 @@ void loop()
112112 rtc.getPrediv (&a, &s);
113113 Serial.print (" Async/Sync for default LSI clock: " );
114114 Serial.print (a); Serial.print (' /' ); Serial.println (s);
115- rtc_config (clkSource, rtc.RTC_HOUR_24 , mydate, mytime);
115+ rtc_config (clkSource, rtc.HOUR_24 , mydate, mytime);
116116 Serial.print (" Async/Sync for selected clock: " );
117117 rtc.getPrediv (&a, &s);
118118 Serial.print (a); Serial.print (' /' ); Serial.println (s);
119119 rtc.end ();
120120
121- if (clkSource == rtc.RTC_HSE_CLOCK ) {
121+ if (clkSource == rtc.HSE_CLOCK ) {
122122 Serial.print (" User Async/Sync set to " );
123123 Serial.print (userPredA);
124124 Serial.print (" /" );
125125 Serial.print (userPredS);
126126 Serial.print (" : " );
127127 rtc.setPrediv (userPredA, userPredS);
128- rtc_config (clkSource, rtc.RTC_HOUR_24 , mydate, mytime);
128+ rtc_config (clkSource, rtc.HOUR_24 , mydate, mytime);
129129 rtc.getPrediv (&a, &s);
130130 Serial.print (a); Serial.print (' /' ); Serial.println (s);
131131 printDateTime (10 , 1000 , false );
132132 }
133133
134134 Serial.print (" User Async/Sync reset use the computed one: " );
135135 rtc.setPrediv (-1 , -1 );
136- rtc_config (clkSource, rtc.RTC_HOUR_24 , mydate, mytime);
136+ rtc_config (clkSource, rtc.HOUR_24 , mydate, mytime);
137137 rtc.getPrediv (&a, &s);
138138 Serial.print (a); Serial.print (' /' ); Serial.println (s);
139139
140140 // Check date change
141141 Serial.println (" Testing date and time" );
142142 Serial.println (" 24H format, new year" );
143- rtc_config (clkSource, rtc.RTC_HOUR_24 , " Dec 31 2017" , " 23:59:56" );
143+ rtc_config (clkSource, rtc.HOUR_24 , " Dec 31 2017" , " 23:59:56" );
144144 printDateTime (8 , 1000 , false );
145145 Serial.println ();
146146
147147#ifndef STM32F1xx
148148 Serial.println (" 12H format, new year" );
149- rtc_config (clkSource, rtc.RTC_HOUR_12 , " Dec 31 2017" , " 23:59:56" );
149+ rtc_config (clkSource, rtc.HOUR_12 , " Dec 31 2017" , " 23:59:56" );
150150 printDateTime (8 , 1000 , false );
151151 Serial.println ();
152152
153153 Serial.println (" 12H format, from AM to PM" );
154- rtc_config (clkSource, rtc.RTC_HOUR_12 , " Dec 31 2017" , " 11:59:56" );
154+ rtc_config (clkSource, rtc.HOUR_12 , " Dec 31 2017" , " 11:59:56" );
155155 printDateTime (8 , 1000 , false );
156156 Serial.println ();
157157#endif // STM32F1xx
@@ -167,7 +167,7 @@ void loop()
167167 }
168168
169169 Serial.println (" \n Testing alarm" );
170- rtc_config (clkSource, rtc.RTC_HOUR_24 , mydate, mytime);
170+ rtc_config (clkSource, rtc.HOUR_24 , mydate, mytime);
171171 byte alarmSeconds = ((seconds+5 )<60 ) ? seconds+5 : 5 ;
172172 byte alarmMinutes = ((seconds+5 )<60 ) ? minutes : ((minutes+1 )<60 ) ? minutes+1 : 0 ;
173173 byte alarmHours = ((seconds+5 )<60 ) ? hours : ((minutes+1 )<60 ) ? hours : ((hours+1 )<24 ) ? hours+1 : 0 ;
@@ -210,7 +210,7 @@ void loop()
210210 rtc.disableAlarm ();
211211 rtc.detachInterrupt ();
212212
213- rtc_config (clkSource, rtc.RTC_HOUR_24 , mydate, mytime);
213+ rtc_config (clkSource, rtc.HOUR_24 , mydate, mytime);
214214 Serial.println (" \n Alarm disabled. Printing each 10s." );
215215 printDateTime (-1 , 10000 , false );
216216}
0 commit comments