Calling custom function in interrupt handler
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2011-04-28 11:31 PM
Posted on April 29, 2011 at 08:31
Calling custom function in interrupt handler
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2011-05-17 5:33 AM
Posted on May 17, 2011 at 14:33
Hi Norbert,
as you are talking about classes and static methods, I assume you are using C++. In an interrupt handler custom functions can be called (as from any other ''normal'' function). When you are using C++ you have to make sure that the called function uses a C function signature instead of a C++ signature. That can be archived by a forward declaration likeextern ''C''{ void myFunction(int param); } in your .h file. This method works only for function in the global scope and not for class functions/methods. If you want to invoke a static class method, you need a wrapper function in the .cpp file with a c signature (as mentioned above). Within that function you can call the C++ method:<file: test.cpp> void myFunction(int param) { MyClass::function(param); } </file: test.cpp> Carsten