CMake definitions

December 21, 2021 ยท View on GitHub

branchbuild statuscoverage
mastercantp CIcodecov
developcantp CIcodecov

CMake definitions

The following definitions might be set by the user, depending on the needs.

definitionvaluesdefaultdescription
AUTOSAR_STD_HEADER_PATH-CanTp/test/stub/commonspecifies the directory containing AUTOSAR standard headers ComStack_Types.h and Std_Types.h (used when integrating this module in an other project)
CANTP_CONFIG_FILEPATH-CanTp/config/can_tp.jsonspecifies which json configuration file should be used to generate the auto-generated code
CANTP_ENABLE_TESTON/OFFOFFenables/disables tests.
ENABLE_DETON/OFFONenables/disables development error detections (see AUTOSAR DET module)
ENABLE_DOC_GENON/OFFOFFenables/disables generation of Doxygen documentation
ENABLE_PC_LINTON/OFFOFFenables/disables generation of targets related to static code analysis (should be disabled if PC-Lint software is not available)
MISRA_C_VERSION1998/2004/20122012specifies which version of MISRA should be used when performing static code analysis (only used if ENABLE_PC_LINT is set)
OS_GET_TIME_APION/OFFOFFindicates whether the OSEK API GetElapsedValue is available or not. If enabled, the user is responsible to provide the function uint32_t CanTp_GetElapsedValue(void)

To use this feature, simply add -D<definition>=<value> when configuring the build with CMake.

Notes

Bellow, a few point to consider when using this module:

  • This module does not support nested interrupts. In other words, the functions CanTp_RxIndication, CanTp_TxConfirmation and CanTp_MainFunction (if scheduled using timer interrupt) should not be able to interrupt each other.

TODO

  • Protect variables used in both synchronous and asynchronous APIs.