Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: {To TomW} GCC-Bug in IRQs

2006-03-27 by Sten

frankcallaghan9 wrote:
> 
> Hi Guys,
> I've just hit this problem in my UART handler, I'm new to the ARM
> and haven't used it's asm yet! could one of you ASM gurus
> please post the required inline entry/exit code for us dummys
> thanks,

Hello Frank,

if you want to use "manually" written prologue/epilogue instead of a stub try this:

#define VIC_GCCFIX_IRQ_PROLOGUE()                                               \
        __asm__ __volatile__(   "       sub     lr, lr, #4              \n"     \
                                "       stmdb   sp!, {r0-r12,lr}        \n");
#define VIC_GCCFIX_IRQ_EPILOGUE()       \
        __asm__ __volatile__(   "       ldmia   sp!, {r0-r12,pc}        \n");

void myIRQ(void) __attribute__((interrupt("IRQ"), naked));

void myIRQ(void) {
	VIC_GCCFIX_IRQ_PROLOGUE();
	/* ... */
	VIC_GCCFIX_IRQ_EPILOGUE();
}

   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/

************************************************/

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.