1
0
mirror of https://github.com/sjlongland/atinysynth.git synced 2025-10-26 00:11:45 +10:00

main: timer: Invert button states

There's a pull-up with the button asserting a logic low, so invert the
inputs.
This commit is contained in:
Stuart Longland 2017-05-27 15:01:41 +10:00
parent f8346cdea9
commit f2fac87ba3
Signed by: stuartl
GPG Key ID: F954BBBB7948D546

View File

@ -141,7 +141,7 @@ ISR(TIMER0_COMPA_vect) {
/* We are reading inputs */
uint8_t diff;
button_last = button_state;
button_state = PINA;
button_state = ~PINA;
/* Determine differences from last */
diff = button_state ^ button_last;
/* Detect button presses & releases */
@ -161,7 +161,7 @@ ISR(TIMER0_COMPA_vect) {
PORTB |= GPIO_EN;
/* Wait for latch */
_delay_us(1);
/* Switch pin direction */
/* Switch to reading inputs */
DDRA = 0x00;
}