david90
Advanced Member level 1
how come the interrupt source code below doesn't break? Am I missing something? I just want it to inc. var "a" each time there is a change in int pin 4. This is for 2313 btw.
======
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/signal.h>
int a=1,b=0;
INTERRUPT(SIG_INTERRUPT1)
{
a++;
}
void main (void)
{
DDRD=0;
while(1)
{
b=a;
}
}
======
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/signal.h>
int a=1,b=0;
INTERRUPT(SIG_INTERRUPT1)
{
a++;
}
void main (void)
{
DDRD=0;
while(1)
{
b=a;
}
}