Yahoo Groups archive

Lpc2000

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

Message

Exception Handling

2006-04-03 by gtechnzltd

Hi there,

Any advice on exception handling. Do you think this is the best 
using the GCC tools.

1: Define the exception handles and functions in main, EG:
 //prototype exception handling functions
 void IRQ_Routine (void)   __attribute__ ((interrupt("IRQ")));
 void FIQ_Routine (void)   __attribute__ ((interrupt("FIQ")));
 void SWI_Routine (void)   __attribute__ ((interrupt("SWI")));
 void UNDEF_Routine (void) __attribute__ ((interrupt("UNDEF")));

 //exception handling functions
 void IRQ_Routine (void) {while (1) ;}
 void FIQ_Routine (void)  {while (1) ;}
 void SWI_Routine (void)  {while (1) ;}
 void UNDEF_Routine (void) {while (1) ;}

2: In the start up file define the vectors to the functions in main EG:
Undef_Addr:     .word   UNDEF_Routine /* defined in main.c  */
SWI_Addr:       .word   SWI_Routine   /* defined in main.c  */
PAbt_Addr:      .word   UNDEF_Routine /* defined in main.c  */
DAbt_Addr:      .word   UNDEF_Routine /* defined in main.c  */
IRQ_Addr:       .word   IRQ_Routine   /* defined in main.c  */
FIQ_Addr:       .word   FIQ_Routine   /* defined in main.c  */

Is this all there is to exception handling?

Comments welcome.

Regards
Grant 
NZ

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.