diff --git a/library.json b/library.json index c50457d..02a615d 100644 --- a/library.json +++ b/library.json @@ -7,7 +7,7 @@ "type": "git", "url": "https://github.com/stm32duino/STM32RTC" }, - "version": "1.3.5", + "version": "1.3.6", "frameworks": "arduino", "platforms": "ststm32", "build": { diff --git a/library.properties b/library.properties index 9682a54..795d68f 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=STM32duino RTC -version=1.3.5 +version=1.3.6 author=STMicroelectronics, Wi6Labs maintainer=stm32duino sentence=Allows to use the RTC functionalities of STM32 based boards. diff --git a/src/STM32RTC.h b/src/STM32RTC.h index f92aae9..b8be12b 100644 --- a/src/STM32RTC.h +++ b/src/STM32RTC.h @@ -53,7 +53,7 @@ */ #define STM32_RTC_VERSION_MAJOR (0x01U) /*!< [31:24] major version */ #define STM32_RTC_VERSION_MINOR (0x03U) /*!< [23:16] minor version */ -#define STM32_RTC_VERSION_PATCH (0x05U) /*!< [15:8] patch version */ +#define STM32_RTC_VERSION_PATCH (0x06U) /*!< [15:8] patch version */ /* * Extra label for development: * 0: official release diff --git a/src/rtc.c b/src/rtc.c index 67475c4..847cc16 100644 --- a/src/rtc.c +++ b/src/rtc.c @@ -485,6 +485,8 @@ bool RTC_init(hourFormat_t format, sourceClock_t source, bool reset) RTC_initClock(source); #if defined(STM32F1xx) memcpy(&RtcHandle.DateToUpdate, &BackupDate, 4); + /* Update date automatically by calling HAL_RTC_GetDate */ + RTC_GetDate(&years, &month, &days, &weekDay); /* and fill the new RTC Date value */ RTC_SetDate(RtcHandle.DateToUpdate.Year, RtcHandle.DateToUpdate.Month, RtcHandle.DateToUpdate.Date, RtcHandle.DateToUpdate.WeekDay); diff --git a/src/rtc.h b/src/rtc.h index d647b94..c8d035f 100644 --- a/src/rtc.h +++ b/src/rtc.h @@ -115,7 +115,7 @@ typedef void(*voidCallbackPtr)(void *); #define PREDIVA_MAX 0xFFFFFU #endif /* !STM32F1xx */ -#if defined(STM32F0xx) || defined(STM32L0xx) || \ +#if defined(STM32C0xx) || defined(STM32F0xx) || defined(STM32L0xx) || \ defined(STM32L5xx) || defined(STM32U5xx) #define RTC_Alarm_IRQn RTC_IRQn #define RTC_Alarm_IRQHandler RTC_IRQHandler