60 DIDR0 |= (1 << ADC1D);
63 ENTER_DDR &= ~(1<<ENTER_PIN);
64 ENTER_PUR |= (1<<ENTER_PIN);
67 KEY_DDR &= ~(1<<KEY_PIN);
68 KEY_PUR &= ~(1<<KEY_PIN);
71 adc_init(ADC_CHAN_ADC1, ADC_TRIG_FREE_RUN,
ADC_REF_AVCC, ADC_PS_128);
121 button = KEY_STATE_DONE;
135 key_state_t key_state;
139 if (key_state == KEY_STATE_NO_KEY){
140 if (button == KEY_STATE_DONE){
141 button = KEY_STATE_NO_KEY;
147 if (button == KEY_STATE_DONE){
186 if (!(ENTER_PORT & (1<<ENTER_PIN))){
189 if (reading < 0x00A0){
192 if (reading < 0x0180){
195 if (reading < 0x0280){
198 if (reading < 0x0380){