mbed_version.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /** \addtogroup platform */
  2. /** @{*/
  3. /**
  4. * \defgroup platform_version Version macros
  5. * @{
  6. */
  7. /* mbed Microcontroller Library
  8. * Copyright (c) 2018 ARM Limited
  9. *
  10. * Licensed under the Apache License, Version 2.0 (the "License");
  11. * you may not use this file except in compliance with the License.
  12. * You may obtain a copy of the License at
  13. *
  14. * http://www.apache.org/licenses/LICENSE-2.0
  15. *
  16. * Unless required by applicable law or agreed to in writing, software
  17. * distributed under the License is distributed on an "AS IS" BASIS,
  18. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. * See the License for the specific language governing permissions and
  20. * limitations under the License.
  21. */
  22. #ifndef MBED_VERSION_H
  23. #define MBED_VERSION_H
  24. #define MBED_LIBRARY_VERSION 163
  25. /** MBED_MAJOR_VERSION
  26. * Mbed 2 major version
  27. */
  28. #define MBED_MAJOR_VERSION 2
  29. /** MBED_MINOR_VERSION
  30. * Mbed 2 minor version
  31. */
  32. #define MBED_MINOR_VERSION 0
  33. /** MBED_PATCH_VERSION
  34. * Mbed 2 patch version
  35. */
  36. #define MBED_PATCH_VERSION 163
  37. #define MBED_ENCODE_VERSION(major, minor, patch) ((major)*10000 + (minor)*100 + (patch))
  38. #define MBED_VERSION MBED_ENCODE_VERSION(MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION)
  39. #define MBED_VERSION_CHECK(major, minor, patch) do { \
  40. MBED_STATIC_ASSERT((MBED_VERSION >= MBED_ENCODE_VERSION((major),(minor),(patch))), "Incompatible mbed-os version detected!!"); \
  41. } while(0)
  42. #endif
  43. /** @}*/
  44. /** @}*/