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