How to wrap all "const" variables in macros using Embedded Coder?
8 views (last 30 days)
Show older comments
MathWorks Support Team
on 23 Nov 2022
Answered: MathWorks Support Team
on 24 Jan 2023
Using Embedded Coder, is there a way to add macro code (#define and #include statements) before and after all "const" variable declarations in the generated code? For example I would like to add macros as shown below around the "const" variable "var1":
#define L1_CONST_DATA /* added before autocoded const */
#include "L1_DATA.h"
const var1;
#define L1_CONST_DATA /* added after autocoded const */
#include "L1_DATA.h"
Accepted Answer
MathWorks Support Team
on 23 Nov 2022
Using the documented workflow below, you should be able to achieve your goals by using a similar method to this workflow with "#define" and "#include" instead of "#pragma."
https://www.mathworks.com/help/ecoder/ug/control-data-and-function-placement-in-memory-by-inserting-pragmas.html
0 Comments
More Answers (0)
See Also
Categories
Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!