PWM module does not want to access the custom interrupt routine but always jumps to the default rout

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

PWM module does not want to access the custom interrupt routine but always jumps to the default rout

跳至解决方案
269 次查看
fi_schi_
Contributor I

Hi there,

I am working with the FRDM-MCXA153 board.
I´m trying to get an interruot on every rising edge using the standart PWM example portet to c++.
So far so simpe, bit unfortunately the interrupt always wants to jump tot the standart interrupt routine (declared as WEAK) and ignores my self-written one.

The PWM module is configured via ConfigTools -> Peripherals -> FLEXPWM0 and should generate an interrupt at VAL2.

Thanks in advance for your help.

标签 (1)
0 项奖励
回复
1 解答
259 次查看
snech99
Contributor I

Hi,

if your main-file is written in c++, you need to add extern "C" before your ISR.

Following is a short text I found in the startup file:

 

//*****************************************************************************

// Forward declaration of the core exception handlers.

// When the application defines a handler (with the same name), this will

// automatically take precedence over these weak definitions.

// If your application is a C++ one, then any interrupt handlers defined

// in C++ files within in your main application will need to have C linkage

// rather than C++ linkage. To do this, make sure that you are using extern "C"

// { .... } around the interrupt handler within your main application code.

//*****************************************************************************

 

在原帖中查看解决方案

0 项奖励
回复
1 回复
260 次查看
snech99
Contributor I

Hi,

if your main-file is written in c++, you need to add extern "C" before your ISR.

Following is a short text I found in the startup file:

 

//*****************************************************************************

// Forward declaration of the core exception handlers.

// When the application defines a handler (with the same name), this will

// automatically take precedence over these weak definitions.

// If your application is a C++ one, then any interrupt handlers defined

// in C++ files within in your main application will need to have C linkage

// rather than C++ linkage. To do this, make sure that you are using extern "C"

// { .... } around the interrupt handler within your main application code.

//*****************************************************************************

 

0 项奖励
回复