PIT Interrupt only work on Main for C++ code?

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

PIT Interrupt only work on Main for C++ code?

ソリューションへジャンプ
1,275件の閲覧回数
thiagopalmieri
Contributor III

Hello,

I am trying to implement a PIT interrupt on a C++ program.

I have already inserted the extern "C" guards on the interrupt and positioned it outside a Class, but on a different .cpp file than Main function, on the same file that triggers it.

In such scenario the interrupt does not work; however if I just move the interrupt to the main.cpp file it works like a charm. As further information, I am instantiating the class (a singleton) on the main function for PIT testing.

I searched the forums but did not find any explanation about it, is this the expected behavior? Or is there anything else I am missing so I can move it to another .cpp file?

I am using SDK version 2.6.0 (2019-06-14) for the K22FN microcontroller running at 96MHz.

Thanks for your support,

Thiago

ラベル(1)
タグ(3)
0 件の賞賛
返信
1 解決策
1,156件の閲覧回数
ErichStyger
Specialist I

I would check the linker .map file if it really is there with the unmangled name?

There must be something you have missed with placing it in a different file.

If in the different file it uses the unmangled name too, there should be no difference.

I hope this helps,

Erich

元の投稿で解決策を見る

2 返答(返信)
1,157件の閲覧回数
ErichStyger
Specialist I

I would check the linker .map file if it really is there with the unmangled name?

There must be something you have missed with placing it in a different file.

If in the different file it uses the unmangled name too, there should be no difference.

I hope this helps,

Erich

1,156件の閲覧回数
thiagopalmieri
Contributor III

Hi Erich,

Thanks for the tip on the map file.

Now it is working. For some reason it was not before, probably I did something wrong when "C" guarding the function that it was not being recognized as a C function.

Anyhow, to look into the map file is a good way to detect such C/C++ interaction problems.

Thanks !

0 件の賞賛
返信