Skip to content

Commit dba10d9

Browse files
committed
Add STM32 RTC library version
Based on Semantic Versioning 2.0.0 (https://semver.org/) This will ease core dependencies. * STM32_RTC_VERSION_MAJOR -> major version * STM32_RTC_VERSION_MINOR -> minor version * STM32_RTC_VERSION_PATCH -> patch version * STM32_RTC_VERSION_EXTRA -> Extra label with: - 0: official release - [1-9]: release candidate - F[0-9]: development * STM32_RTC_VERSION --> Full version number Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 0df97f0 commit dba10d9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/STM32RTC.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,24 @@
4646
#error "RTC configuration is missing. Check flag HAL_RTC_MODULE_ENABLED in variants/board_name/stm32yzxx_hal_conf.h"
4747
#endif
4848

49+
/**
50+
* @brief STM32 RTC library version number
51+
*/
52+
#define STM32_RTC_VERSION_MAJOR (0x01U) /*!< [31:24] major version */
53+
#define STM32_RTC_VERSION_MINOR (0x01U) /*!< [23:16] minor version */
54+
#define STM32_RTC_VERSION_PATCH (0x00U) /*!< [15:8] patch version */
55+
/*
56+
* Extra label for development:
57+
* 0: official release
58+
* [1-9]: release candidate
59+
* F[0-9]: development
60+
*/
61+
#define STM32_RTC_VERSION_EXTRA (0x00U) /*!< [7:0] extra version */
62+
#define STM32_RTC_VERSION ((STM32_RTC_VERSION_MAJOR << 24U)\
63+
|(STM32_RTC_VERSION_MINOR << 16U)\
64+
|(STM32_RTC_VERSION_PATCH << 8U )\
65+
|(STM32_RTC_VERSION_EXTRA))
66+
4967
typedef void(*voidFuncPtr)(void *);
5068

5169
#define IS_CLOCK_SOURCE(SRC) (((SRC) == STM32RTC::LSI_CLOCK) || ((SRC) == STM32RTC::LSE_CLOCK) ||\

0 commit comments

Comments
 (0)