Skip to content

Make stm32_interrupt_enable() and stm32_interrupt_disable() callable from C #188

@terrillmoore

Description

@terrillmoore

It appears that the intent was that stm32_interrupt_enable() and stm32_interrupt_disable() should be callable from C. But the header file (cores/arduino/stm32/interrupt.h) neglected to declare them extern "C", so they can't be. (There's an overload from stm32_interrupt_enable() using a std::function<> wrapper, and the header file makes that invisible when included in a .c file. But since the visible stm32_interrupt_enable() is implemented in a C++ file, you get a link error when you try to link. Ditto for stm32_interrupt_disable().

The solution is to wrap in the C-ish things in extern "C" in interrupt.h when compiling in C++; that way, the functions will be callable from C.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions