Skip to content

Commit

Permalink
export the RTC Handle as a global
Browse files Browse the repository at this point in the history
Set the subsecond for the alarm value.

Signed-off-by: Francois Ramu <[email protected]>
  • Loading branch information
FRASTM committed Sep 7, 2023
1 parent 2ea1ffc commit 6d3ceec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ extern "C" {
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
static RTC_HandleTypeDef RtcHandle = {0};
static voidCallbackPtr RTCUserCallback = NULL;
static void *callbackUserData = NULL;
#ifdef RTC_ALARM_B
Expand Down Expand Up @@ -94,6 +93,9 @@ static inline int _log2(int x)
return (x > 0) ? (sizeof(int) * 8 - __builtin_clz(x) - 1) : 0;
}

/* Exported variable --------------------------------------------------------*/
RTC_HandleTypeDef RtcHandle = {0};

/* Exported functions --------------------------------------------------------*/

/**
Expand Down Expand Up @@ -737,7 +739,7 @@ void RTC_GetDate(uint8_t *year, uint8_t *month, uint8_t *day, uint8_t *wday)
*/
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)
{
RTC_AlarmTypeDef RTC_AlarmStructure;
RTC_AlarmTypeDef RTC_AlarmStructure = {0};

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

0 comments on commit 6d3ceec

Please sign in to comment.