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

How to call a C function instead of macro in RTX51 tiny

Hello,

I'm trying to have a C function called when the tick timer 0 is interrupted.
in the manual it has this macro where i'm supposed to write the macro but the problem is my code is in C and I don't know how i'm supposed to implement a function call here

HW_TIMER_CODE MACRO RETI //how to call function ? ENDM

Parents
  • Your subject line is misleading almost to the point of being a flat-out lie.

    Your problem is not that you're to write "a macro"; it is that it's to be an assembly language macro. And no, you really should not be trying to call a C function from inside that macro. If calling C functions had been considered safe to do from that place, the callback would surely have been made a C function.

    Either way: whatever it is you actually want to do here should almost certainly be done in an entirely different way. So take a few steps back, to what your actual goal was, and re-start thinking about methods from there.

Reply
  • Your subject line is misleading almost to the point of being a flat-out lie.

    Your problem is not that you're to write "a macro"; it is that it's to be an assembly language macro. And no, you really should not be trying to call a C function from inside that macro. If calling C functions had been considered safe to do from that place, the callback would surely have been made a C function.

    Either way: whatever it is you actually want to do here should almost certainly be done in an entirely different way. So take a few steps back, to what your actual goal was, and re-start thinking about methods from there.

Children