Merge branch 'feature/idf_version_header' into 'master'

esp_common: add esp_idf_version.h header to define IDF version

Closes IDF-253

See merge request idf/esp-idf!4596
This commit is contained in:
Angus Gratton
2019-06-13 09:41:35 +08:00
16 changed files with 167 additions and 9 deletions

View File

@@ -109,6 +109,21 @@ SDK version
:cpp:func:`esp_get_idf_version` returns a string describing the IDF version which was used to compile the application. This is the same value as the one available through ``IDF_VER`` variable of the build system. The version string generally has the format of ``git describe`` output.
To get the version at build time, additional version macros are provided. They can be used to enable or disable parts of the program depending on IDF version.
* :c:macro:`ESP_IDF_VERSION_MAJOR`, :c:macro:`ESP_IDF_VERSION_MINOR`, :c:macro:`ESP_IDF_VERSION_PATCH` are defined to integers representing major, minor, and patch version.
* :c:macro:`ESP_IDF_VERSION_VAL` and :c:macro:`ESP_IDF_VERSION` can be used when implementing version checks:
.. code-block:: c
#include "esp_idf_version.h"
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)
// enable functionality present in IDF v4.0
#endif
App version
-----------
Application version is stored in :cpp:class:`esp_app_desc_t` structure. It is located in DROM sector and has a fixed offset from the beginning of the binary file.
@@ -125,5 +140,6 @@ API Reference
-------------
.. include:: /_build/inc/esp_system.inc
.. include:: /_build/inc/esp_idf_version.inc