DDRA &= ~(_BV(PA3) | _BV(PA4)); // set as input
PORTA |= _BV(PA3) | _BV(PA4); // enable internal pull-ups
- GIMSK &= ~_BV(PCIE1); // disable pin-change IRQ on port B
- GIMSK |= _BV(PCIE0);
+ GIMSK &= ~_BV(PCIE0);
+ GIMSK |= _BV(PCIE1);
PCMSK0 = _BV(PCINT3) | _BV(PCINT4);
// disable pin-change IRQs on all pins except PA3,PA4
} else if (!cur && !prev) { // --- is still pressed ---
uint16_t duration = jiffies - button_start[button];
- if (duration > 80) {
+ if (duration > 160) {
set_status_led(button, on1_pattern);
// acknowledge long press
}
} else if (cur && !prev) { // --- just released ---
uint16_t duration = jiffies - button_start[button];
- if (duration > 6 && duration < 30) {
+ if (duration > 6 && duration < 60) {
short_press(button);
- } else if (duration > 80) {
+ } else if (duration > 160) {
set_status_led(button, NULL);
long_press(button);
}