Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Interrupt handling with mixed C and Assembly

$
0
0

I am writing C code as a separate module to be used by a bigger project written in assembly.  Currently I have interrupts triggered in assembly which calls a function in C to do necessary tasks.  But how does one get assembly to trigger an ISR in C directly using IAR Workbench?

Here is what I tried and didn't work...

(in assembly file)

EXTERN   SOME_ISR        ;C interrupt routine

RSEG  INTVEC

DW            SOME_ISR        ;isr at FFF0

RSEG  MCODE

-----------------------------------------------------------------

(in C file)

#pragma  vector=SOME_HARDWARE_VECTOR         //this caused a duplicate vector error with assembly

extern      "C"

__interrupt  void  SOME_ISR(void)

{

   Do some stuff

}

-----------------------------------------------------------------


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>