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
NZMessage
Exception Handling
2006-04-03 by gtechnzltd
Attachments
- No local attachments were found for this message.