1.0 KiB
TargetLink Custom Code Blocks
[TOC]
The Custom Code Block
The custom code block enables to easily insert custom written snippets of c code.
Make sure to use a proper code review, as it is easy to cause underflow and overflow errors. The usage of Polyspace Code Prover is advised.
It could also be an idea to run Polyspace bugfinder.
Sharing the C Code
By deploying the generated c code from the custom code blocks to a common folder, it can be shared between simulink models (similarily to shared TargetLink functions).
Read the Manual
There are some docs in the TargetLink documentation DSPace docs under: Custom Code Blocks.
Also, there is a demo model, in the MATLAB Command Window, enter tl_demos custom_blocks
.
Header Files
Include Statements in Custom Code blocks should not be used, but replaced by "AddFile" blocks.
This complies to MISRA rule 19.1. Include directives which says that only preprocessor directives or comments may be placed before include directives.