|
Hi sivananda,
There is an auto generated ISR_1.c file generated in A_MyFirstInterruptProject where the follwoing interrupt handler code is written.
/*******************************************************************************
* Place your includes, defines and code here
********************************************************************************/
/* `#START isr_1_intc` */
#include <Timer_1.h>
/* Global variable definition */
volatile uint8 toggle_flag = 0;
/* `#END` */
CY_ISR(isr_1_Interrupt)
{
/* Place your Interrupt code here. */ /* `#START isr_1_Interrupt` */
/* Read the timer status register to clear the interrupt */
Timer_1_ReadStatusRegister();
/* Set the flag variable */
toggle_flag = 1;
/* `#END` */
}
This the space made available to handle code.
Instead, there is an alternate way doin this.You can define the function in the source code files which is done in the second example proj in appnote (B_PicuInterruptProject). Use the following lines in main.c files to acheive this:
CY_ISR(my_interrupt_routine)
{
// interrupt handle code
}
main()
{
CYGlobalIntEnable;
ISR_1_StartEx(my_interrupt_routine);
}
The isr.c and .h files are generated for every interrupt that you use. To avoid using these generated files, use the above lines of code to do it in the source files.
Hope this helps.
Thanks,
srim
|