/* * GccApplication3.c * * Created: 08.10.2018 15:21:47 * Author : student */ #include #include #include #include //----------------------------------------------------- volatile int x; ISR(INT0_vect) { TCNT1=0; x++; } ISR(INT1_vect) { TIMSK=0; } ISR(Timer1_COMPA_vect) { if(x<7) x++; } int main(void) { TCCRA=0; TCCRB=0; TCNT1=0; OCR1A=977; TIMSK = _BV(OCIE1A); TCCR1A= _BV(CS12) | _BV(CS10) | _BV(WGM12); DDRB=0xFF; GICR=_BV(INT0) | _BV(INT1); MCUCR= _BV(ISC11) | _BV(ISC01); sei(); x=0; /* Replace with your application code */ while (1) { sleep_mode(); PORTB=~_BV(x); } }