You've already forked M5Unit-TimerPWR-Internal-FW
mirror of
https://github.com/m5stack/M5Unit-TimerPWR-Internal-FW.git
synced 2026-05-20 11:31:37 -07:00
31 lines
572 B
C
31 lines
572 B
C
/*
|
|
* SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
#ifndef __BUTTON_H__
|
|
#define __BUTTON_H__
|
|
|
|
#include "main.h"
|
|
#include "gpio.h"
|
|
|
|
#define BUTTON_FILTER 500
|
|
#define BUTTON_FILTER_TIMEROUT BUTTON_FILTER*3
|
|
|
|
typedef struct
|
|
{
|
|
uint8_t button_status;
|
|
unsigned long button_delay;
|
|
uint8_t is_pressed;
|
|
uint8_t is_longlongpressed;
|
|
uint8_t was_click;
|
|
uint8_t was_longpress;
|
|
uint8_t was_longlongpress;
|
|
} button_t;
|
|
|
|
extern button_t my_button_a;
|
|
extern button_t my_button_b;
|
|
|
|
void button_update(void);
|
|
|
|
#endif |