Mistake on this page?
Report an issue in GitHub or email us
mbed_version.h
1 
2 /** \addtogroup platform */
3 /** @{*/
4 /**
5  * \defgroup platform_version Version macros
6  * @{
7  */
8 /* mbed Microcontroller Library
9  * Copyright (c) 2018 ARM Limited
10  * SPDX-License-Identifier: Apache-2.0
11  *
12  * Licensed under the Apache License, Version 2.0 (the "License");
13  * you may not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */
24 
25 #ifndef MBED_VERSION_H
26 #define MBED_VERSION_H
27 
28 /** MBED_MAJOR_VERSION
29  * Mbed OS major version
30  *
31  * @note 99 is default value for development version (master branch)
32  */
33 #define MBED_MAJOR_VERSION 99
34 
35 /** MBED_MINOR_VERSION
36  * Mbed OS minor version
37  *
38  * @note 99 is default value for development version (master branch)
39  */
40 #define MBED_MINOR_VERSION 99
41 
42 /** MBED_PATCH_VERSION
43  * Mbed OS patch version
44  *
45  * @note 99 is default value for development version (master branch)
46  */
47 #define MBED_PATCH_VERSION 99
48 
49 #define MBED_ENCODE_VERSION(major, minor, patch) ((major)*10000 + (minor)*100 + (patch))
50 
51 /** MBED_VERSION
52  * Mbed OS 5 version (MMmmpp - M(Major); m(minor); p(patch))
53  *
54  * @note 999999 is default value for development version (master branch)
55  */
56 #define MBED_VERSION MBED_ENCODE_VERSION(MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION)
57 
58 /** MBED_VERSION_CHECK
59  * Macro can be used to check minimum Mbed OS version required for feature/library. If current version
60  * is less than required, it will assert.
61  *
62  * @note: Version of master branch will be 999999 as default, hence no assert/warning is provided for
63  * master branch code
64  */
65 #define MBED_VERSION_CHECK(major, minor, patch) do { \
66  MBED_STATIC_ASSERT((MBED_VERSION >= MBED_ENCODE_VERSION((major),(minor),(patch))), "Incompatible mbed-os version detected!!"); \
67  } while(0)
68 
69 #endif
70 
71 /** @}*/
72 /** @}*/
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.