This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28027: How to call C function from ISR written in assembly?

Part Number: TMS320F28027

Do I need to do anything special with a C function called from an ISR written in assembly?

For example, is this okay:

Assembly

.global _testisr
.global _testfunc

_testisr:
LCR _testfunc
NOP
IRET

C

void testfunc(){
GpioDataRegs.GPATOGGLE.bit.GPIO1 = 1;
}

  • Hello Mark,

    What you have is fine, just make sure you have proper indentation for your assembly code otherwise you will get compiler errors:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    .global _testisr
    .global _testfunc
    _testisr:
    LCR _testfunc
    NOP
    IRET
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX