From 36c7af7daa34e1092d51ab69c38f039199d15da5 Mon Sep 17 00:00:00 2001 From: Alexandre Bourdiol Date: Wed, 12 Jan 2022 15:36:46 +0100 Subject: [PATCH 1/3] feat(C0): Add RTC C0 support Signed-off-by: Alexandre Bourdiol --- src/rtc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From fdebabcbe6335065d0ce19aa041e2da2827cc251 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Tue, 24 Jan 2023 10:52:25 +0100 Subject: [PATCH 2/3] fix(F1): properly update date Fixes #87 Signed-off-by: Frederic Pillon --- src/rtc.c | 2 ++ 1 file changed, 2 insertions(+) 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); From 3ff29af2c6c28c5b8c7c9d04b035305d76451268 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Wed, 25 Jan 2023 16:32:44 +0100 Subject: [PATCH 3/3] chore: update version to 1.3.6 Signed-off-by: Frederic Pillon --- library.json | 2 +- library.properties | 2 +- src/STM32RTC.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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