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

ソリューションへジャンプ
1,198件の閲覧回数
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 解決策
1,188件の閲覧回数
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 返信
1,189件の閲覧回数
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 件の賞賛
返信
%3CLINGO-SUB%20id%3D%22lingo-sub-1885121%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EPWM%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%81%AF%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0%E5%89%B2%E3%82%8A%E8%BE%BC%E3%81%BF%E3%83%AB%E3%83%BC%E3%83%81%E3%83%B3%E3%81%AB%E3%82%A2%E3%82%AF%E3%82%BB%E3%82%B9%E3%81%97%E3%81%9F%E3%81%8F%E3%81%AA%E3%81%84%E3%81%8C%E3%80%81%E5%B8%B8%E3%81%AB%E3%83%87%E3%83%95%E3%82%A9%E3%83%AB%E3%83%88%E3%81%AE%E3%83%AB%E3%83%BC%E3%83%88%E3%81%AB%E3%82%B8%E3%83%A3%E3%83%B3%E3%83%97%E3%81%99%E3%82%8B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1885121%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E3%80%81%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%E7%A7%81%E3%81%AFFRDM-MCXA153%E3%83%9C%E3%83%BC%E3%83%89%E3%81%A7%E4%BD%9C%E6%A5%AD%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%3CBR%20%2F%3E%E7%A7%81%E3%81%AF%E3%80%81%E6%A8%99%E6%BA%96%E7%9A%84%E3%81%AAPWM%E3%81%AE%E4%BE%8B%E3%81%AEportet%E3%82%92C%20%2B%2B%E3%81%AB%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%80%81%E3%81%99%E3%81%B9%E3%81%A6%E3%81%AE%E7%AB%8B%E3%81%A1%E4%B8%8A%E3%81%8C%E3%82%8A%E3%82%A8%E3%83%83%E3%82%B8%E3%81%A7interruot%E3%82%92%E5%8F%96%E5%BE%97%E3%81%97%E3%82%88%E3%81%86%E3%81%A8%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%3CBR%20%2F%3E%E3%81%93%E3%82%8C%E3%81%BE%E3%81%A7%E3%81%AE%E3%81%A8%E3%81%93%E3%82%8D%E3%80%81%E5%B0%91%E3%81%97%E5%8D%98%E7%B4%94%E3%81%A7%E3%81%99%E3%81%8C%E3%80%81%E6%AE%8B%E5%BF%B5%E3%81%AA%E3%81%8C%E3%82%89%E3%80%81%E5%89%B2%E3%82%8A%E8%BE%BC%E3%81%BF%E3%81%AF%E5%B8%B8%E3%81%AB%E6%A8%99%E6%BA%96%E3%81%AE%E5%89%B2%E3%82%8A%E8%BE%BC%E3%81%BF%E3%83%AB%E3%83%BC%E3%83%81%E3%83%B3(WEAK%E3%81%A8%E3%81%97%E3%81%A6%E5%AE%A3%E8%A8%80)%E3%81%AB%E3%82%B8%E3%83%A3%E3%83%B3%E3%83%97%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E6%80%9D%E3%81%A3%E3%81%A6%E3%81%8A%E3%82%8A%E3%80%81%E7%A7%81%E3%81%AE%E8%87%AA%E4%BD%9C%E3%81%AE%E3%83%AB%E3%83%BC%E3%83%81%E3%83%B3%E3%82%92%E7%84%A1%E8%A6%96%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3EPWM%20%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%81%AF%20ConfigTools%20%26gt%3B%20Peripherals%20-%26gt%3B%20FLEXPWM0%20%E3%82%92%E4%BB%8B%E3%81%97%E3%81%A6%E6%A7%8B%E6%88%90%E3%81%95%E3%82%8C%E3%80%81VAL2%20%E3%81%A7%E5%89%B2%E3%82%8A%E8%BE%BC%E3%81%BF%E3%82%92%E7%94%9F%E6%88%90%E3%81%99%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%E3%81%94%E5%8D%94%E5%8A%9B%E3%81%AB%E6%84%9F%E8%AC%9D%E3%81%84%E3%81%9F%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1885121%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EMCXA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1885175%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3APWM%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%81%AF%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0%E5%89%B2%E3%82%8A%E8%BE%BC%E3%81%BF%E3%83%AB%E3%83%BC%E3%83%81%E3%83%B3%E3%81%AB%E3%82%A2%E3%82%AF%E3%82%BB%E3%82%B9%E3%81%97%E3%81%9F%E3%81%8F%E3%81%82%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93%E3%81%8C%E3%80%81%E5%B8%B8%E3%81%AB%E3%83%87%E3%83%95%E3%82%A9%E3%83%AB%E3%83%88%E3%81%AB%E3%82%B8%E3%83%A3%E3%83%B3%E3%83%97%E3%81%97%E3%81%BE%E3%81%99%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1885175%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%E3%83%A1%E3%82%A4%E3%83%B3%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%8CC%20%2B%2B%E3%81%A7%E6%9B%B8%E3%81%8B%E3%82%8C%E3%81%A6%E3%81%84%E3%82%8B%E5%A0%B4%E5%90%88%E3%81%AF%E3%80%81ISR%E3%81%AE%E5%89%8D%E3%81%ABextern%20%22C%22%E3%82%92%E8%BF%BD%E5%8A%A0%E3%81%99%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%E4%BB%A5%E4%B8%8B%E3%81%AF%E3%80%81%E3%82%B9%E3%82%BF%E3%83%BC%E3%83%88%E3%82%A2%E3%83%83%E3%83%97%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%A7%E8%A6%8B%E3%81%A4%E3%81%91%E3%81%9F%E7%9F%AD%E3%81%84%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3CDIV%3E%3CDIV%3E%3CP%3E%3CSPAN%3E%2F%2F*****************************************************************************%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%E3%82%B3%E3%82%A2%E4%BE%8B%E5%A4%96%E3%83%8F%E3%83%B3%E3%83%89%E3%83%A9%E3%81%AE%E5%89%8D%E6%96%B9%E5%AE%A3%E8%A8%80%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%8C%E3%83%8F%E3%83%B3%E3%83%89%E3%83%A9%E3%82%92(%E5%90%8C%E3%81%98%E5%90%8D%E5%89%8D%E3%81%A7)%E5%AE%9A%E7%BE%A9%E3%81%99%E3%82%8B%E3%81%A8%E3%80%81%E6%AC%A1%E3%81%AE%E3%82%88%E3%81%86%E3%81%AB%E3%81%AA%E3%82%8A%E3%81%BE%E3%81%99%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%E3%81%AF%E3%80%81%E3%81%93%E3%82%8C%E3%82%89%E3%81%AE%E5%BC%B1%E3%81%84%E5%AE%9A%E7%BE%A9%E3%82%88%E3%82%8A%E3%82%82%E8%87%AA%E5%8B%95%E7%9A%84%E3%81%AB%E5%84%AA%E5%85%88%E3%81%95%E3%82%8C%E3%81%BE%E3%81%99%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%8C%20C%2B%2B%20%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AE%E5%A0%B4%E5%90%88%E3%81%AF%E3%80%81%E5%AE%9A%E7%BE%A9%E3%81%95%E3%82%8C%E3%81%9F%E5%89%B2%E3%82%8A%E8%BE%BC%E3%81%BF%E3%83%8F%E3%83%B3%E3%83%89%E3%83%A9%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%E3%83%A1%E3%82%A4%E3%83%B3%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E5%86%85%E3%81%AEC%20%2B%2B%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%A7%E3%81%AF%E3%80%81C%E3%83%AA%E3%83%B3%E3%82%B1%E3%83%BC%E3%82%B8%E3%81%8C%E5%BF%85%E8%A6%81%E3%81%A7%E3%81%99%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%20C%2B%2B%20%E3%83%AA%E3%83%B3%E3%82%B1%E3%83%BC%E3%82%B8%E3%81%A7%E3%81%AF%E3%81%AA%E3%81%8F%E3%80%82%E3%81%93%E3%82%8C%E3%82%92%E8%A1%8C%E3%81%86%E3%81%AB%E3%81%AF%E3%80%81%3C%2FSPAN%3E%3CSPAN%3Eextern%3C%2FSPAN%3E%3CSPAN%3E%20%22C%22%3C%2FSPAN%3E%20%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%E3%81%93%E3%81%A8%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%3C%2FP%3E%3CP%3E%3CSPAN%3E%7B%20....%20%7D%20%E3%82%92%E3%83%A1%E3%82%A4%E3%83%B3%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%B3%E3%83%BC%E3%83%89%E5%86%85%E3%81%AE%E5%89%B2%E3%82%8A%E8%BE%BC%E3%81%BF%E3%83%8F%E3%83%B3%E3%83%89%E3%83%A9%E3%81%AE%E5%91%A8%E5%9B%B2%E3%81%AB%E9%85%8D%E7%BD%AE%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%2F%2F*****************************************************************************%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E