1 // Copyright 2019 Espressif Systems (Shanghai) PTE LTD 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #pragma once 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 /** Major version number (X.x.x) */ 22 #define ESP_IDF_VERSION_MAJOR 4 23 /** Minor version number (x.X.x) */ 24 #define ESP_IDF_VERSION_MINOR 4 25 /** Patch version number (x.x.X) */ 26 #define ESP_IDF_VERSION_PATCH 1 27 28 /** 29 * Macro to convert IDF version number into an integer 30 * 31 * To be used in comparisons, such as ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0) 32 */ 33 #define ESP_IDF_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch)) 34 35 /** 36 * Current IDF version, as an integer 37 * 38 * To be used in comparisons, such as ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0) 39 */ 40 #define ESP_IDF_VERSION ESP_IDF_VERSION_VAL(ESP_IDF_VERSION_MAJOR, \ 41 ESP_IDF_VERSION_MINOR, \ 42 ESP_IDF_VERSION_PATCH) 43 44 #ifndef __ASSEMBLER__ 45 46 /** 47 * Return full IDF version string, same as 'git describe' output. 48 * 49 * @note If you are printing the ESP-IDF version in a log file or other information, 50 * this function provides more information than using the numerical version macros. 51 * For example, numerical version macros don't differentiate between development, 52 * pre-release and release versions, but the output of this function does. 53 * 54 * @return constant string from IDF_VER 55 */ 56 const char* esp_get_idf_version(void); 57 58 #endif 59 60 #ifdef __cplusplus 61 } 62 #endif 63