41 #include <avr/interrupt.h>
42 #include <avr/sleep.h>
44 #include <util/delay.h>
75 set_sleep_mode(SLEEP_MODE_PWR_DOWN);
78 set_sleep_mode(SLEEP_MODE_PWR_SAVE);
81 TCCR2A = (1<<CS22)|(1<<CS21)|(1<<CS20);
93 EIMSK |= (1 << PCIE0);
95 PCMSK0 |= (1 << PCINT2);
98 while (ENTER_PORT & (1<<ENTER_PIN)) {
100 if (!howlong--)
break;
104 EIMSK &= ~(1 << PCIE0);
105 PCMSK0&= ~(1 <<PCINT2);
106 TIMSK2&= ~(1 << TOIE2);