diff options
Diffstat (limited to 'lock/util.c')
| -rw-r--r-- | lock/util.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lock/util.c b/lock/util.c index 32a1fcf..683faa2 100644 --- a/lock/util.c +++ b/lock/util.c @@ -1,9 +1,18 @@ #include <avr/io.h> #include <avr/interrupt.h> -#include <avr/wdt.h> +#include <util/delay.h> #include "util.h" +int is_btn_pressed(uint8_t pin, uint8_t btn) +{ + if (!((pin >> btn) & 0x01)) { + _delay_us(2000); + return !((pin >> btn) & 0x01); + } + return 0; +} + void xor(const char *k, const char *s, char *d, uint8_t n) { int i; |
