How do I prevent code generation macros

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How do I prevent code generation macros

ソリューションへジャンプ
961件の閲覧回数
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 解決策
754件の閲覧回数
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 返答(返信)
755件の閲覧回数
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 件の賞賛
754件の閲覧回数
MikeM
Contributor III

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

0 件の賞賛
754件の閲覧回数
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 件の賞賛