git.droids-corp.org
/
beacon-rx-433.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix the button action
[beacon-rx-433.git]
/
main.c
diff --git
a/main.c
b/main.c
index
e176a1f
..
82f12d7
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-27,7
+27,7
@@
#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)
@@
-359,6
+359,7
@@
static void beep(void)
BUZZER_ON();
else
BUZZER_OFF();
BUZZER_ON();
else
BUZZER_OFF();
+ wait_period();
}
}
#endif
}
}
#endif
@@
-382,6
+383,7
@@
int main(void)
/* 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 */
#endif
i = 0;
#endif
i = 0;
@@
-391,6
+393,7
@@
int main(void)
/* wait until 200us is elapsed since previous call (5Khz) */
wait_period();
/* wait until 200us is elapsed since previous call (5Khz) */
wait_period();
+ detected = 0;
#ifndef HOST_VERSION
/* filter button */
#ifndef HOST_VERSION
/* filter button */