Signed-off-by: Olivier Matz <zer0@droids-corp.org>
#define RADIO_READ() (!!(PINB & (_BV(RADIO_BIT))))
#define BUTTON_BIT 3
-#define BUTTON_IS_PRESSED() (!!(PINB & (_BV(BUTTON_BIT))))
+#define BUTTON_IS_PRESSED() (!(PINB & (_BV(BUTTON_BIT))))
#define LED_BIT 4
#define LED_ON() PORTB |= _BV(LED_BIT)
BUZZER_ON();
else
BUZZER_OFF();
+ wait_period();
}
}
#endif
/* led and buzzer are outputs */
#if defined(__AVR_ATtiny45__)
DDRB |= (1 << LED_BIT) | (1 << BUZZER_BIT);
+ PORTB |= (1 << BUTTON_BIT); /* pull up */
#endif
i = 0;
/* wait until 200us is elapsed since previous call (5Khz) */
wait_period();
+ detected = 0;
#ifndef HOST_VERSION
/* filter button */