I'm not sure if this forum is good place to ask questions about Embeded C but i saw somone doing this without problem so i guess it's fine(and i'm kinda to desperate to care).
WHenever i add ISR macro no matter what vector i use, or whatever interrupts are disabled or enabled Attiny13a is executing whatever is in {} brackets of that macro in a loop.(in this case it blinks LED connected trough transistor on PIN4 instead of turning this LED on until PINB3 is connected to ground)
i even tried SIGNAL macro and it's same.
I'm using avr-gcc with avr dude (Arduino UNO clone "Elego UNO R3" as ISP) on linux mint.
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
// EMPTY_INTERRUPT(ADC_vect);
ISR(ADC_vect )
{
_delay_ms(100);
PORTB |= _BV(PORTB4);
_delay_ms(100);
PORTB &= ~_BV(PORTB4);
reti ( ) ;
}
int main(void)
{
cli ();
while (1)
{
if (PINB & _BV(PINB3))
{
PORTB |= _BV(PORTB4);
}
else
{
PORTB &= ~_BV(PORTB4);
}
}
}
Strangely enough behavior is same after i comment out #include <avr/interrupt.h> compiler only throws some warnings.