aboutsummaryrefslogtreecommitdiff
path: root/src/button.h
blob: 8aa7442ed4bbbd8d0f01eced11d3042ee2191df9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#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();
#endif