How do I prevent code generation macros

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How do I prevent code generation macros

跳至解决方案
965 次查看
MikeM
Contributor III

I'm using CoedWarrior Development Studio10.6.4 to design C/C++ code for the S08DZ32 MCU. I am using processor expert to generate bit I/O drivers. The problem I am having is that the generate code implements macros rather than methods much of the time. I have a lot of bit I/O that I would like to put in an array of function pointers and, of course, you can't implement macros this way. I've searched everywhere for an answer to this including searching through all the project settings to see if there is a way to force method generation rather than macros. I have not been able to find anything. Modifying the generated code is not an option because it will be written over during the next clean and build. Does anyone know of a way to do this? Thank you very much.

0 项奖励
1 解答
758 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Mike,

There is a method : after you change the code, then enable the "Don't Write Generated Component Modules"

to prevent change your code. Please right click the component -> Code Generation -> Don't Write Generated Component Modules :

Hope it helps

在原帖中查看解决方案

0 项奖励
3 回复数
759 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Mike,

There is a method : after you change the code, then enable the "Don't Write Generated Component Modules"

to prevent change your code. Please right click the component -> Code Generation -> Don't Write Generated Component Modules :

Hope it helps

0 项奖励
758 次查看
MikeM
Contributor III

Thanks Alice. I did not know you could do that. Shows what a CodeWarrior expert I am :-) Thanks so much!

0 项奖励
758 次查看
MikeM
Contributor III

I found the exact solution I originally wanted. There IS a way to force the compiler to generate functions rather than macros. It is a simple setting for the processor in the Components Inspector using Processor Expert. Simply click on the Processor in the Components list (MC9S08DZ32 in my case). Then select the "Build options" tab and scroll down to "Generate macros". Then simply "yes" or "no".

0 项奖励