Interrupt Service Routine (ISR) outside a class

I just read the article by Nick Gammon: http://www.gammon.com.au/forum/?id=12983; yes it's an old production, but I believe still valid.

As I live under the impression that in the Arduino IDE [and PlatformIO] we can mix C-program's and C++ programs freely, the question arises:
Why don't we use a C-program when putting Interrupt Service Routines in a library?

C has no knowledge of classes, so we don't have to bother about them.

Please correct me when I'm wrong.

C++ has always been backwards compatible with C.

unless the library you're using uses and defines the ISR, there's no reason you can't write your own ISR

C++ (at Bell Labs) originally translated C++ code into C. you can certainly implement objects with C structs.

see How's is this program working? - #9 by gcjr

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.