takashi kadono / Mbed OS Nucleo_446

Dependencies:   ssd1331

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mbed_version.h Source File

mbed_version.h

00001 
00002 /** \addtogroup platform */
00003 /** @{*/
00004 /**
00005  * \defgroup platform_version Version macros
00006  * @{
00007  */
00008 /* mbed Microcontroller Library
00009  * Copyright (c) 2018 ARM Limited
00010  *
00011  * Licensed under the Apache License, Version 2.0 (the "License");
00012  * you may not use this file except in compliance with the License.
00013  * You may obtain a copy of the License at
00014  *
00015  *     http://www.apache.org/licenses/LICENSE-2.0
00016  *
00017  * Unless required by applicable law or agreed to in writing, software
00018  * distributed under the License is distributed on an "AS IS" BASIS,
00019  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00020  * See the License for the specific language governing permissions and
00021  * limitations under the License.
00022  */
00023 
00024 #ifndef MBED_VERSION_H
00025 #define MBED_VERSION_H
00026 
00027 /** MBED_MAJOR_VERSION
00028   * Mbed OS major version
00029   *
00030   * @note 99 is default value for development version (master branch)
00031   */
00032 #define MBED_MAJOR_VERSION  99
00033 
00034 /** MBED_MINOR_VERSION
00035   * Mbed OS minor version
00036   *
00037   * @note 99 is default value for development version (master branch)
00038   */
00039 #define MBED_MINOR_VERSION  99
00040 
00041 /** MBED_PATCH_VERSION
00042   * Mbed OS patch version
00043   *
00044   * @note 99 is default value for development version (master branch)
00045   */
00046 #define MBED_PATCH_VERSION  99
00047 
00048 #define MBED_ENCODE_VERSION(major, minor, patch) ((major)*10000 + (minor)*100 + (patch))
00049 
00050 /** MBED_VERSION
00051   * Mbed OS 5 version (MMmmpp - M(Major); m(minor); p(patch))
00052   *
00053   * @note 999999 is default value for development version (master branch)
00054   */
00055 #define MBED_VERSION MBED_ENCODE_VERSION(MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION)
00056 
00057 /** MBED_VERSION_CHECK
00058   * Macro can be used to check minimum Mbed OS version required for feature/library. If current version
00059   * is less than required, it will assert.
00060   *
00061   * @note: Version of master branch will be 999999 as default, hence no assert/warning is provided for
00062   * master branch code
00063   */
00064 #define MBED_VERSION_CHECK(major, minor, patch) do { \
00065                                        MBED_STATIC_ASSERT((MBED_VERSION >= MBED_ENCODE_VERSION((major),(minor),(patch))), "Incompatible mbed-os version detected!!"); \
00066                                      } while(0)
00067 
00068 #endif
00069 
00070 /** @}*/
00071 /** @}*/