version.c 879 B

1234567891011121314151617
  1. #include "version/version.h"
  2. #pragma location=".progver"
  3. static __root const sProgVer_t _hidden_sProgramVersion = PROGVER_FILLER_v0("ACMx4,USBTMC.SCPI");
  4. #pragma location=".progvercrc"
  5. static __root const sProgVerCRC_t _hidden_sProgramVersionChecksumm;
  6. // 13/09/18
  7. // @pProgramVersion: Volatile accessor for @_hidden_sProgramVersion
  8. // Makes the compiller to avoid inlining sProgVer_t's fields inside code
  9. // when the direct access is used, e.g _hidden_sProgramVersion.firmware_version
  10. // Due to the @_hidden_sProgramVersion is actually hidden object inaccessible
  11. // from other modules, the only way to get access is volatile accessor @pProgramVersion.
  12. // But because of this pointer is 'volatile' the compiller avoids inlining while
  13. // accessing fields and works with fields by reading acutal memory.
  14. volatile const sProgVer_t * pProgramVersion = &_hidden_sProgramVersion;