Skip to content

Commit 7abbe02

Browse files
committed
export the RTC Handle as a global
Set the subsecond for the alarm value.
1 parent 5eb64d0 commit 7abbe02

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/rtc.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ extern "C" {
5656
/* Private define ------------------------------------------------------------*/
5757
/* Private macro -------------------------------------------------------------*/
5858
/* Private variables ---------------------------------------------------------*/
59-
static RTC_HandleTypeDef RtcHandle = {0};
6059
static voidCallbackPtr RTCUserCallback = NULL;
6160
static void *callbackUserData = NULL;
6261
#ifdef RTC_ALARM_B
@@ -90,6 +89,9 @@ static inline int _log2(int x)
9089
return (x > 0) ? (sizeof(int) * 8 - __builtin_clz(x) - 1) : 0;
9190
}
9291

92+
/* Exported variable --------------------------------------------------------*/
93+
RTC_HandleTypeDef RtcHandle = {0};
94+
9395
/* Exported functions --------------------------------------------------------*/
9496

9597
/**
@@ -698,7 +700,7 @@ void RTC_GetDate(uint8_t *year, uint8_t *month, uint8_t *day, uint8_t *wday)
698700
*/
699701
void RTC_StartAlarm(alarm_t name, uint8_t day, uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSeconds, hourAM_PM_t period, uint8_t mask)
700702
{
701-
RTC_AlarmTypeDef RTC_AlarmStructure;
703+
RTC_AlarmTypeDef RTC_AlarmStructure = {0};
702704

703705
/* Ignore time AM PM configuration if in 24 hours format */
704706
if (initFormat == HOUR_FORMAT_24) {

0 commit comments

Comments
 (0)