blob: bb41eb6b5c374b0cb24e3e51c926c057c07dd6ee (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
|