How to wrap all "const" variables in macros using Embedded Coder?

11 次查看(过去 30 天)
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"

采纳的回答

MathWorks Support Team
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 个)

类别

Help CenterFile Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息

产品


版本

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by