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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,414 Views
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

Labels (1)
Tags (3)
0 Kudos
Reply
1 Solution
1,295 Views
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

View solution in original post

2 Replies
1,296 Views
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,295 Views
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 Kudos
Reply