1 /* 2 * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #pragma once 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /** Major version number (X.x.x) */ 14 #define ESP_IDF_VERSION_MAJOR 5 15 /** Minor version number (x.X.x) */ 16 #define ESP_IDF_VERSION_MINOR 1 17 /** Patch version number (x.x.X) */ 18 #define ESP_IDF_VERSION_PATCH 5 19 20 /** 21 * Macro to convert IDF version number into an integer 22 * 23 * To be used in comparisons, such as ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0) 24 */ 25 #define ESP_IDF_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch)) 26 27 /** 28 * Current IDF version, as an integer 29 * 30 * To be used in comparisons, such as ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0) 31 */ 32 #define ESP_IDF_VERSION ESP_IDF_VERSION_VAL(ESP_IDF_VERSION_MAJOR, \ 33 ESP_IDF_VERSION_MINOR, \ 34 ESP_IDF_VERSION_PATCH) 35 36 #ifndef __ASSEMBLER__ 37 38 /** 39 * Return full IDF version string, same as 'git describe' output. 40 * 41 * @note If you are printing the ESP-IDF version in a log file or other information, 42 * this function provides more information than using the numerical version macros. 43 * For example, numerical version macros don't differentiate between development, 44 * pre-release and release versions, but the output of this function does. 45 * 46 * @return constant string from IDF_VER 47 */ 48 const char* esp_get_idf_version(void); 49 50 #endif 51 52 #ifdef __cplusplus 53 } 54 #endif 55