//processor: Atmel AVR Atmega8
#define F_CPU 8000000UL
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
ISR(INT1_vect) { //fires at rising edge
GICR=0; MCUCR=0; MCUCR |= (1<<ISC01); GICR |= (1<<INT0);
//for the next int. set int0 at falling edge
PORTB=0; //flag for infinite loop
while(PORTB==0) {PORTC=1; PORTC=0;}
}
ISR(INT0_vect) { //fires at falling edge
GICR=0; MCUCR=0; MCUCR |= (1<<ISC10)|(1<<ISC11); GICR |= (1<<INT1);
//for the next int. set int1 at rising edge
PORTB=1; //changing flag, trying to stop infinite loop
}
int main (void) {
DDRC |= 1; DDRB |= 1;
MCUCR=0; MCUCR |= (1<<ISC10)|(1<<ISC11); GICR=0; GICR |= (1<<INT1); sei();
//default int. setting: int_1 at rising edge
while(1) {/*doing nothing*/}
return 0; }