NVIC management (porting from Codewarrior)

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

NVIC management (porting from Codewarrior)

1,603件の閲覧回数
rosigna
Contributor I

Hello,

 

I'm porting a project for KL26Z128 from Codewarrior to MCUxpresso IDE. The old project was not created by me, so I was not concerned about some choices made about low level configuration.

Now I'm trying to port the following instructions:

 tInterruptStatus = NVIC_ISER;
NVIC_ICER = 0xFFFFFFFF;


[some instructions here]

while(NVIC_ISER != tInterruptStatus)
{
  NVIC_ISER = tInterruptStatus;
}


I guess that code executed in [some instructions here] must be executed being sure that no interrupt occurs.

I only found in core_cm0plus.h (and fsl_common.h) utilities to enable/disable one interrupt (IRQ and/or "pending" IRQ at a time), there is no intermediate utility to access directly the whole NVIC_ISER/NVIC_ICER register.

Could I introduce an utility to reproduce the same behaviour from my original source code or I have to proceed one interrupt at a time using the disableIrq/enableIrq available functions?

Or do you have any different advice to manage this?

Thank you very much! 

0 件の賞賛
返信
2 返答(返信)

1,593件の閲覧回数
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello

 

The available functions to disable the interruptions are: DisableIRQ() and DisableGlobalIRQ().

 

In DisableGlobalIRQ() all the interruptions are disabled while in DisableIRQ() you need to specify which interruption you want to disable.

Out of this functions there are any other function available, for you purpose I think that DisableIRQ() is a good option.

 

Let me know if this is helpful, if you have more questions do not hesitate to ask me.

Best regards,

Omar

0 件の賞賛
返信

1,565件の閲覧回数
rosigna
Contributor I

Hello,

 

Thank you. Your advice confirms my understanding, so I will do as you suggest.

I guess that I could introduce a local bitmask to control which interrupt are enabled/disabled time by time, in order to have a local copy of the low level mask.

Could this be a good compromise between old and new source code?

 

Thank you!

 Rosa

0 件の賞賛
返信