title: Using reti() at the end of an ISR
body: <p>i have problem that this code doesnt work .. 
  the ISR is working .. i tested the blinking of it in other code .. </p>
  
  <p>but to put the x++ in ISR and reading X in main() function it never blinks. ..</p>
  
  <p>im not familier with asm i thought this is compiler optomization so i put the variable volatile but it didnt work .. </p>
  
  <pre><code>#define F_CPU 16000000UL
  
  #include &lt;avr/interrupt.h&gt;
  #include &lt;avr/io.h&gt;
  #include &lt;util/delay.h&gt;
  
  volatile static uint8_t x = 1;
  
  ISR( TIMER0_OVF_vect )
  {
      x++;
      reti();
  }
  
  int main(void)
  {
  
      /* Replace with your application code */
      DDRB = DDRB | 0B00100000 ; // pinMode(13,OUTPUT);
      TCCR0A = 0;
      TCCR0B = (1 &lt;&lt; CS00 ) | (1 &lt;&lt; CS02 ); //1024 prescaler
      TIMSK0 |= 1 &lt;&lt; TOIE0 ;
      sei();
  
      while (1) 
      {
  
          if (x  &gt;= 61) //never happens ? 
          {
              PORTB ^= 0B00100000;
              x=0;    
          }
  
      }
  }
  </code></pre>