This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C++ Interrupt

I would like design a c++ class where an interrupt function b.e. EXTI0_IRQHandler is a member. How does it work ?

Parents
  • How does it work ?

    In a nutshell: it doesn't.

    Interrupts handlers generally need some special treatment compared to ordinary functions (different prologue and epilogue, more saved registers, ...). Member functions also need some special treatment compared to ordinary functions (the "this" pointer, primarily). Problem is, those two special treatments conflict with each other

    There is hardly anything at all to be gained from doing that, anyway.

    So my suggestion is: forget it.

Reply
  • How does it work ?

    In a nutshell: it doesn't.

    Interrupts handlers generally need some special treatment compared to ordinary functions (different prologue and epilogue, more saved registers, ...). Member functions also need some special treatment compared to ordinary functions (the "this" pointer, primarily). Problem is, those two special treatments conflict with each other

    There is hardly anything at all to be gained from doing that, anyway.

    So my suggestion is: forget it.

Children