David Hawkins wrote:
>>YES, something like that! ;-) But without nesting and change of cpu-mode.
>
>
> Then perhaps this :)
>
> irq_isr:
> sub lr, lr, #4
> stmfd sp!, {r0-r3, ip, lr}
> bl irq_handler
> ldmfd sp!, {r0-r3, ip, pc}^
>
>
> /* VICVectAddr dispatch loop */
> void irq_handler(void)
> {
> /* Process IRQ interrupts */
> irq_handler_t handler;
> while (VICIRQStatus) {
> /* Get the address of the highest priority handler */
> handler = (irq_handler_t)VICVectAddr;
>
> /* Execute the handler */
> (*handler)();
>
> /* Acknowledge the VIC */
> VICVectAddr = 0;
> }
> }
>
Wonderful! ;-)
But why to save r0..r3 and ip in your irq_isr?!? Only lr will be changed by bl and registers used by
irq_handler() should be saved in its function prologue by irq_handler() itself!
Sten
--
/************************************************
Do you need a tiny and efficient real time
operating system (RTOS) with a preemtive
multitasking for LPC2000 or AT91SAM7?
http://nanortos.net-attack.de/
Or some open-source tools and code for LPC2000?
http://www.net-attack.de/
************************************************/Message
Re: [lpc2000] {To TomW} GCC-Bug in IRQs
2006-03-25 by Sten
Attachments
- No local attachments were found for this message.