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

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

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

跳至解决方案
1,416 次查看
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,297 次查看
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,298 次查看
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,297 次查看
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 项奖励
回复