cancel
Showing results for 
Search instead for 
Did you mean: 

IRQHandler

swiggers9
Associate II
Posted on October 26, 2006 at 06:37

IRQHandler

4 REPLIES 4
swiggers9
Associate II
Posted on October 25, 2006 at 12:42

Hello,

I want to combine some assembly routines which handle my interrupts.

First I have the IRQHandler which stores some registers onto the stack and calls my irq subroutine.

next I have the irq subroutine which call two macros to switch between system and irq mode and calls the irq handler.

This code works fine but I want to combine all the macros into the IRQHandler so I get one piece of assembly code.

Is this possible and can someone give me that code since I don't understand asm code?

Thanks

p.s. attached you find the startup code and the irq handlers

[ This message was edited by: s-wiggers on 25-10-2006 16:17 ]

________________

Attachments :

irq.s : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtJ4&d=%2Fa%2F0X0000000aLN%2FjphBDqOv44Yf9h020Fax10HsAIPo9rTVSxxD.iXxBLE&asPdf=false

Startup.s : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtJ9&d=%2Fa%2F0X0000000aLO%2Fy6qQs402oCpgrXMPTLeCUs38.aKd7WkS_huG7q8AXvw&asPdf=false
kleshov
Associate II
Posted on October 25, 2006 at 16:57

Here is how I handle interrupts. I modified interrupt handling code provided by ST. See if it makes any sense to you.

Regards,

- mike

________________

Attachments :

irq.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtJE&d=%2Fa%2F0X0000000aLQ%2Fw6xATMKbEkthGKu_B7HPAxv2sWItjAqAqwpDAi4JRsY&asPdf=false
swiggers9
Associate II
Posted on October 26, 2006 at 05:08

Hello,

I see that you also have the ENABLE_IRQ() code in your irq handler.

is it possible to put this code into the global irq_handler?? so I don't have to put it into every irq handler.

Thanks.

kleshov
Associate II
Posted on October 26, 2006 at 06:37

Yes, it can be done. You have to do it in the right order: read EIC_IVR first, then enable interrupts and call ISR. EIC initialization code would have to be modified too in order to accommodate a new way of calling ISRs via EIC_IVR.

The reason why I didn't do it is that interrupt handling code would inevitably become slower because of the manipulations with EIC_IVR. It kind of defeats the purpose of EIC_IVR, which is there to speed up interrupt handling.

But if an extra microsecond or so in interrupt response time is not a problem, then what you are suggesting makes a lot of sense. I'll look into it when I have time.

Regards,

- mike