version.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * This file is free software: you can redistribute it and/or modify it
  3. * under the terms of the GNU General Public License as published by the
  4. * Free Software Foundation, either version 3 of the License, or
  5. * (at your option) any later version.
  6. *
  7. * This file is distributed in the hope that it will be useful, but
  8. * WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. * See the GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License along
  13. * with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #define FORCE_VERSION_H_INCLUDE
  16. #include "version.h"
  17. #undef FORCE_VERSION_H_INCLUDE
  18. #include <AP_Common/AP_FWVersion.h>
  19. const AP_FWVersion AP_FWVersion::fwver{
  20. .major = FW_MAJOR,
  21. .minor = FW_MINOR,
  22. .patch = FW_PATCH,
  23. .fw_type = FW_TYPE,
  24. #ifndef GIT_VERSION
  25. .fw_string = THISFIRMWARE,
  26. .fw_hash_str = "",
  27. #else
  28. .fw_string = THISFIRMWARE " (" GIT_VERSION ")",
  29. .fw_hash_str = GIT_VERSION,
  30. #endif
  31. .middleware_name = nullptr,
  32. .middleware_hash_str = nullptr,
  33. #ifdef CHIBIOS_GIT_VERSION
  34. .os_name = "ChibiOS",
  35. .os_hash_str = CHIBIOS_GIT_VERSION,
  36. #else
  37. .os_name = nullptr,
  38. .os_hash_str = nullptr,
  39. #endif
  40. #ifdef BUILD_DATE_YEAR
  41. // encode build date in os_sw_version
  42. .os_sw_version = (BUILD_DATE_YEAR*100*100) + (BUILD_DATE_MONTH*100) + BUILD_DATE_DAY,
  43. #else
  44. .os_sw_version = 0,
  45. #endif
  46. };