esp_idf_version.h 2.0 KB

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