DSPRelated.com
Forums

Return from interruption in C Code

Started by fire...@yahoo.es May 15, 2008
Hello

How can I return from an interruption working in C Code? In other words: what's the equivalent to RTI or RETI (assembler) in C Code? I'm searching in the documentation and in forum but I don't find anything.

Thanks you for all your help

Eduardo Méndez
Hello,

You do not need to place an RTI instruction while in C code. When you declare a function with the "interrupt" pragma, the compiler will know that this one is the ISR (Interrupt Servicing Routine) and will create all the additional code to correclty handling the interrupt when it occurs, inlcuding the RTI at the end.

Your question was like "How can I return from a subroutine working in C Code? In other
words: what's the equivalent to RTS (assembler) in C Code?" And I guess you already understand that the C run time / compiler takes care of that, generating for you the RTS where needed; you actually do not have to place manually in your C code. Is equivalent in the interrupt case.

Regards.


Jaime Andr Aranguren Cardona
j...@ieee.org
j...@computer.org
----- Original Message ----
From: "f...@yahoo.es"
To: a...
Sent: Thursday, May 15, 2008 4:02:43 AM
Subject: [adsp] Return from interruption in C Code

Hello

How can I return from an interruption working in C Code? In other words: what's the equivalent to RTI or RETI (assembler) in C Code? I'm searching in the documentation and in forum but I don't find anything.

Thanks you for all your help

Eduardo Mdez
Hello

Thanks you all of you for your help. It was very useful.

As Jaime has said, the solution to indicate to the DSP that the ISR has finished (in C Code), is simply declare the function with "#pragma interrupt". Like this:

#pragma interrupt
void address(int dummy)

Then the compiler will place an RETI instruction to return from this routine while generating the code. Not RETS.

Thanks you

Eduardo MÉNDEZ

Hello
>
>How can I return from an interruption working in C Code? In other words: what's the equivalent to RTI or RETI (assembler) in C Code? I'm searching in the documentation and in forum but I don't find anything.
>
>Thanks you for all your help
>
>Eduardo Méndez
>
>
Hello,
Eduardo, I am glad that you got it.
Remember that you also need to use of of the interrupt() functions, in one of its many flavors (normal, fast, super-fast, etc)to hook up the ISR to the interrupt source.
Regards,

Jaime Andr Aranguren Cardona
j...@ieee.org
j...@computer.org
----- Original Message ----
From: "f...@yahoo.es"
To: a...
Sent: Friday, May 16, 2008 4:13:27 AM
Subject: [adsp] Re: Return from interruption in C Code
Hello

Thanks you all of you for your help. It was very useful.

As Jaime has said, the solution to indicate to the DSP that the ISR has finished (in C Code), is simply declare the function with "#pragma interrupt". Like this:

#pragma interrupt
void address(int dummy)

Then the compiler will place an RETI instruction to return from this routine while generating the code. Not RETS.

Thanks you

Eduardo MDEZ

Hello
>
>How can I return from an interruption working in C Code? In other words: what's the equivalent to RTI or RETI (assembler) in C Code? I'm searching in the documentation and in forum but I don't find anything.
>
>Thanks you for all your help
>
>Eduardo Mdez
>
>