From f881a27fba82681e64346f4fc318106e299e9dd4 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Wed, 14 Jul 2021 19:34:24 +0200 Subject: [PATCH] core: add STM8 core version number Based on Semantic Versioning 2.0.0 (https://semver.org/) This will ease core dependencies. * STM8_CORE_VERSION_MAJOR -> major version * STM8_CORE_VERSION_MINOR -> minor version * STM8_CORE_VERSION_PATCH -> patch version * STM8_CORE_VERSION_EXTRA -> Extra label with: - 0: official release - [1-9]: release candidate - F[0-9]: development * STM8_CORE_VERSION --> Full version number Signed-off-by: Frederic Pillon --- cores/arduino/stm8/stm8_def.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cores/arduino/stm8/stm8_def.h b/cores/arduino/stm8/stm8_def.h index bdde6ec..5e5eff6 100644 --- a/cores/arduino/stm8/stm8_def.h +++ b/cores/arduino/stm8/stm8_def.h @@ -1,6 +1,24 @@ #ifndef _STM8_DEF_ #define _STM8_DEF_ +/** + * @brief STM8 core version number + */ +#define STM8_CORE_VERSION_MAJOR (0x01U) /*!< [31:24] major version */ +#define STM8_CORE_VERSION_MINOR (0x00U) /*!< [23:16] minor version */ +#define STM8_CORE_VERSION_PATCH (0x00U) /*!< [15:8] patch version */ +/* + * Extra label for development: + * 0: official release + * [1-9]: release candidate + * F[0-9]: development + */ +#define STM8_CORE_VERSION_EXTRA (0x00U) /*!< [7:0] extra version */ +#define STM8_CORE_VERSION ((STM8_CORE_VERSION_MAJOR << 24U)\ + |(STM8_CORE_VERSION_MINOR << 16U)\ + |(STM8_CORE_VERSION_PATCH << 8U )\ + |(STM8_CORE_VERSION_EXTRA)) + #if defined(STM8Sxx) #include "stm8s.h" #elif defined(STM8Lxx)