cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt handler

ezanen9
Associate II
Posted on September 01, 2005 at 06:19

Interrupt handler

1 REPLY 1
ezanen9
Associate II
Posted on September 01, 2005 at 05:46

I have a tool that generates the basics for a project inclusive the mian.c, start.s and interrupt.c.

In the interrupt.c there are a few handler functions. The interrupt.c code:

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

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

#define global extern /* to declare external variables and functions */

/* BEGIN USER CODE INCLUDE */

/* END USER CODE INCLUDE */

/* BEGIN USER CODE DEFINES */

/* END USER CODE DEFINES */

void SWI_Handler (void) __attribute__ ((interrupt (''SWI'')));

void PAbt_Handler (void) __attribute__ ((interrupt (''ABORT'')));

void DAbt_Handler (void) __attribute__ ((interrupt (''ABORT'')));

void Undef_Handler (void) __attribute__ ((interrupt (''UNDEF'')));

void FIQ_Handler (void) __attribute__ ((interrupt (''FIQ'')));

/* BEGIN USER CODE FUNCTIONS1 */

/* END USER CODE FUNCTIONS1 */

void SWI_Handler (void)

{

/* BEGIN USER CODE SWI */

main();

/* END USER CODE SWI */

}

void PAbt_Handler (void)

{

/* BEGIN USER CODE PABT */

main();

/* END USER CODE PABT */

}

void DAbt_Handler (void)

{

/* BEGIN USER CODE DABT */

main();

/* END USER CODE DABT */

}

void Undef_Handler (void)

{

/* BEGIN USER CODE UNDEF */

main();

/* END USER CODE UNDEF */

}

void FIQ_Handler (void)

{

/* BEGIN USER CODE FIQ */

/* END USER CODE FIQ */

}

/* BEGIN USER CODE FUNCTIONS2 */

/* END USER CODE FUNCTIONS2 */

The next problem I have with all my programma's, happening on random time intervals.

When one of my programs is running, the program sometimes enters one of the handler functions above. This is strange because I do not call or jump to this functions in my software.

Where are these functions for? Stands SWI_Handler for the handling of the software interrupts? I disabled all the software interrupts and the software still enters this function sometimes.

Where are the PABT/DAbt/ UNdef_handler functions for? And why does my code enters these functions even if I do not call them?

Is it for handling hardware instability? In this case what do I put into these funtions? Now I let the software return to the main function to restart, but sometimes it then restarts more then ones a second.

Has somebody an explanation?