esp_idf_version.h 1.5 KB

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