I have variables which are to be used in interrupt only should they be volatile also
but I have defined them above ISR routine as I want to retain their value.
Nested interrupt can come in my case, but I don't use these variables in nested interrupt.
uint8_t x;
volatile uint8_t y;
void isr(void)
{
y = x;
x++;
}
main()
{
x = 0;
configure_isr();
while( y < 300);
///statrements
}
but I have defined them above ISR routine as I want to retain their value.
Nested interrupt can come in my case, but I don't use these variables in nested interrupt.
uint8_t x;
volatile uint8_t y;
void isr(void)
{
y = x;
x++;
}
main()
{
x = 0;
configure_isr();
while( y < 300);
///statrements
}