Interrupt Handlers in C++ applications

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

Interrupt Handlers in C++ applications

3,592件の閲覧回数
lpcware-support
Senior Contributor I

When you create a project using the LPCXpresso IDE project wizard, the startup code generated contains a set of default interrupt handlers, dependent upon the target MCU.

These default interrupt handlers are defined as weak so that if your main application provides an implementation, this will be used instead of the default in the generated executable.

However 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 use extern "C" { .... } around the interrupt handler within your main application code.

For more details, please see you favorite C++ text book, alternatively an internet search will bring up lots of useful links - for example:

http://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B#Linking_C_and_C.2B.2B_code

ラベル(1)
1 返信

2,244件の閲覧回数
marles
Contributor I

Very useful tip! It helped me with the same issue with MCUXpresso! Thank you very much!

0 件の賞賛