I'm using CW5.1 and Device Initialization, target is MC9S08QG8.
The issue is I'm using Device Initialization to setup the IIC peripheral and it sets up the vector table, peripheral control register, and enables interupts etc.. In the MCUinit.c file it has the ISR started and says "put your code here", I cant put the global variables in that file because they will be deleted if I "generate code" again.
__interrupt void Viic_isr(void)
{
/* Write your interrupt code here ... */
}
My mistake, i cant "pass" data to main but I do need to have data that the ISR gets from the peripheral made available to main, I assume I need to do this with a global variable.
In the example they dont use Device initialization to set up the peripheral, they put the globals and ISR in main.c.
So the question is if i put the ISR where Device Initialization asks me to put it where and how do I define/declare the global variables that are used in the ISR.