Skip to content

Commit d0e99a6

Browse files
authored
Merge pull request #345 from fpistm/enum_rtc
Change hourAM_PM_t enum member name
2 parents f1a98f3 + 9830251 commit d0e99a6

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

cores/arduino/stm32/rtc.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ void RTC_init(hourFormat_t format, sourceClock_t source)
321321
RTC_SetDate(17, 1, 1, 7);
322322

323323
/*at 0:0:0*/
324-
RTC_SetTime(0,0,0,0,AM);
324+
RTC_SetTime(0,0,0,0,HOUR_AM);
325325

326326
#if !defined(STM32F1xx) && !defined(STM32F2xx) && !defined(STM32L1xx) || defined(STM32L1_ULPH)
327327
/* Enable Direct Read of the calendar registers (not through Shadow) */
@@ -349,7 +349,7 @@ void RTC_DeInit(void)
349349
* @param minutes: 0-59
350350
* @param seconds: 0-59
351351
* @param subSeconds: 0-999
352-
* @param period: select AM or PM period in case RTC is set in 12 hours mode. Else ingored.
352+
* @param period: select HOUR_AM or HOUR_PM period in case RTC is set in 12 hours mode. Else ingored.
353353
* @retval None
354354
*/
355355
void RTC_SetTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSeconds, hourAM_PM_t period)
@@ -358,7 +358,7 @@ void RTC_SetTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSe
358358

359359
/* Ignore time AM PM configuration if in 24 hours format */
360360
if(initFormat == HOUR_FORMAT_24) {
361-
period = AM;
361+
period = HOUR_AM;
362362
}
363363

364364
if((((initFormat == HOUR_FORMAT_24) && IS_RTC_HOUR24(hours)) || IS_RTC_HOUR12(hours))
@@ -367,7 +367,7 @@ void RTC_SetTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSe
367367
RTC_TimeStruct.Minutes = minutes;
368368
RTC_TimeStruct.Seconds = seconds;
369369
#if !defined(STM32F1xx)
370-
if(period == PM) {
370+
if(period == HOUR_PM) {
371371
RTC_TimeStruct.TimeFormat = RTC_HOURFORMAT12_PM;
372372
} else {
373373
RTC_TimeStruct.TimeFormat = RTC_HOURFORMAT12_AM;
@@ -395,7 +395,7 @@ void RTC_SetTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSe
395395
* @param minutes: 0-59
396396
* @param seconds: 0-59
397397
* @param subSeconds: 0-999 (optional could be NULL)
398-
* @param period: AM or PM period in case RTC is set in 12 hours mode (optional could be NULL).
398+
* @param period: HOUR_AM or HOUR_PM period in case RTC is set in 12 hours mode (optional could be NULL).
399399
* @retval None
400400
*/
401401
void RTC_GetTime(uint8_t *hours, uint8_t *minutes, uint8_t *seconds, uint32_t *subSeconds, hourAM_PM_t *period)
@@ -410,9 +410,9 @@ void RTC_GetTime(uint8_t *hours, uint8_t *minutes, uint8_t *seconds, uint32_t *s
410410
#if !defined(STM32F1xx)
411411
if(period != NULL) {
412412
if(RTC_TimeStruct.TimeFormat == RTC_HOURFORMAT12_PM) {
413-
*period = PM;
413+
*period = HOUR_PM;
414414
} else {
415-
*period = AM;
415+
*period = HOUR_AM;
416416
}
417417
}
418418
#if (!defined(STM32F2xx) && !defined(STM32L1xx)) || defined(STM32L1_ULPH)
@@ -478,7 +478,7 @@ void RTC_GetDate(uint8_t *year, uint8_t *month, uint8_t *day, uint8_t *wday)
478478
* @param minutes: 0-59
479479
* @param seconds: 0-59
480480
* @param subSeconds: 0-999
481-
* @param period: AM or PM if in 12 hours mode else ignored.
481+
* @param period: HOUR_AM or HOUR_PM if in 12 hours mode else ignored.
482482
* @param mask: configure alarm behavior using alarmMask_t combination.
483483
* See AN4579 Table 5 for possible values.
484484
* @retval None
@@ -489,7 +489,7 @@ void RTC_StartAlarm(uint8_t day, uint8_t hours, uint8_t minutes, uint8_t seconds
489489

490490
/* Ignore time AM PM configuration if in 24 hours format */
491491
if(initFormat == HOUR_FORMAT_24) {
492-
period = AM;
492+
period = HOUR_AM;
493493
}
494494

495495
if((((initFormat == HOUR_FORMAT_24) && IS_RTC_HOUR24(hours)) || IS_RTC_HOUR12(hours))
@@ -507,7 +507,7 @@ void RTC_StartAlarm(uint8_t day, uint8_t hours, uint8_t minutes, uint8_t seconds
507507
#else
508508
UNUSED(subSeconds);
509509
#endif /* !STM32F2xx && !STM32L1xx || STM32L1_ULPH */
510-
if(period == PM) {
510+
if(period == HOUR_PM) {
511511
RTC_AlarmStructure.AlarmTime.TimeFormat = RTC_HOURFORMAT12_PM;
512512
} else {
513513
RTC_AlarmStructure.AlarmTime.TimeFormat = RTC_HOURFORMAT12_AM;
@@ -567,7 +567,7 @@ void RTC_StopAlarm(void)
567567
* @param minutes: 0-59
568568
* @param seconds: 0-59
569569
* @param subSeconds: 0-999 (optional could be NULL)
570-
* @param period: AM or PM (optional could be NULL)
570+
* @param period: HOUR_AM or HOUR_PM (optional could be NULL)
571571
* @param mask: alarm behavior using alarmMask_t combination (optional could be NULL)
572572
* See AN4579 Table 5 for possible values
573573
* @retval None
@@ -589,9 +589,9 @@ void RTC_GetAlarm(uint8_t *day, uint8_t *hours, uint8_t *minutes, uint8_t *secon
589589
}
590590
if(period != NULL) {
591591
if(RTC_AlarmStructure.AlarmTime.TimeFormat == RTC_HOURFORMAT12_PM) {
592-
*period = PM;
592+
*period = HOUR_PM;
593593
} else {
594-
*period = AM;
594+
*period = HOUR_AM;
595595
}
596596
}
597597
#if !defined(STM32F2xx) && !defined(STM32L1xx) || defined(STM32L1_ULPH)

cores/arduino/stm32/rtc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ typedef enum {
5555
} hourFormat_t;
5656

5757
typedef enum {
58-
AM,
59-
PM
58+
HOUR_AM,
59+
HOUR_PM
6060
} hourAM_PM_t;
6161

6262
/* See AN4579 Table 5 for possible values */

0 commit comments

Comments
 (0)