S12XDP512, CW4.5, GPAGE, interrupts

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

S12XDP512, CW4.5, GPAGE, interrupts

ソリューションへジャンプ
2,816件の閲覧回数
gravity
Contributor I
Hi,
 
Is there any way to get the compiler to push the GPAGE register when invoking functions or interrupts?
 
I'm am trying to increment a globally addressed variable from an interrupt, which is altering the GPAGE, and therefore crashing the rest of the code.
 
Cheers
 
M
ラベル(1)
タグ(1)
0 件の賞賛
1 解決策
470件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
Or alternatively, use the -CpGPAGE option.
-CpGPAGE=0x10

When this option is used, the compiler will generate the register save code for GPAGE in all interrupt functions, but only if the GPAGE could possibly be modified.

The #pragma TRAP_PROC SAVE_ALL_REGS has the drawback that the compiler really saves all page registers, even the ones not used.

Daniel

Message Edited by CompilerGuru on 05-18-200602:38 PM

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
470件の閲覧回数
Technoman64
Contributor III
I found this in Codewarrior Help. I think it is what you are looking for.
 
#pragma TRAP_PROC

Which page registers are saved is determined by the TRAP_PROC pragma. The syntax of this pragma is

#pragma TRAP_PROC [SAVE_ALL_REGS | SAVE_NO_REGS]

If TRAP_PROC SAVE_ALL_REGS is used, all page registers are saved, whether or not they are used in the interrupt procedure. If TRAP_PROC SAVE_NO_REGS is given, no page registers are saved. If only TRAP_PROC is given, all page registers specified with the -Cp option are saved. It is up to you to ensure that no other page registers are modified.

NOTE

The page registers are changed by paged data accesses. For details, see the Paged Variables section.

471件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
Or alternatively, use the -CpGPAGE option.
-CpGPAGE=0x10

When this option is used, the compiler will generate the register save code for GPAGE in all interrupt functions, but only if the GPAGE could possibly be modified.

The #pragma TRAP_PROC SAVE_ALL_REGS has the drawback that the compiler really saves all page registers, even the ones not used.

Daniel

Message Edited by CompilerGuru on 05-18-200602:38 PM

0 件の賞賛