Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4923

Does while(1) affect interrupts?

$
0
0
My question is: Doesn't the program get stuck at while (1)? How is the flow of this program? I mean, can the program execute what is inside while (1) loop and execute interrupts and then go back to while (1)?


#include <avr/io.h>
#include <avr/interrupt.h>
// TIMER0 with prescaler clkI/O/1024
#define TIMER0_PRESCALER (1 << CS02) | (1 << CS00)
void main()
{
// ... do something ...
// init Timer0
TIMSK |= (1 << TOIE0); // interrupt enable - here overflow
TCCR0 |= TIMER0_PRESCALER; // use...

Does while(1) affect interrupts?

Viewing all articles
Browse latest Browse all 4923

Trending Articles