#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/sleep.h>

ISR(TIMER2_OVF_vect) {
    PORTB ^= 0x01;
}

int main(void) {
    DDRB = 0xFF;
    PORTB = 0xFF;
    ASSR |= (1<<AS2);
    TCCR2 = 0x04;
    TIMSK |= (1<<TOIE2);
    sei();
    set_sleep_mode(SLEEP_MODE_PWR_SAVE);
    while (1) {
        sleep_mode();
    }
    return 0;
}
