diff options
Diffstat (limited to 'src/button.h')
| -rw-r--r-- | src/button.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/button.h b/src/button.h new file mode 100644 index 0000000..bb41eb6 --- /dev/null +++ b/src/button.h @@ -0,0 +1,20 @@ +#ifndef _LOADED_BUTTON +#define _LOADED_BUTTON +#include <stdbool.h> +#include <stdint.h> + +#define DEBOUNCE_TICK_COUNT 10 +#define LONG_PRESS_TICK_COUNT 60 +#define MAX_TICK_COUNT 80 + +enum ButtonState { + BUTTON_IDLE = 0, + BUTTON_PRESSED = 1, + BUTTON_LONG_PRESSED = 2, +}; + +uint16_t extern button_tick_count; + +void button_tick(); +enum ButtonState check_button_state(); +#endif |
