Init
This commit is contained in:
commit
b10571f0bb
|
|
@ -0,0 +1,26 @@
|
||||||
|
//
|
||||||
|
// Created by xemon on 16.11.22.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef UVEOS_ON_NATION_USERINPUTBUTTONEVENT_H
|
||||||
|
#define UVEOS_ON_NATION_USERINPUTBUTTONEVENT_H
|
||||||
|
|
||||||
|
#include "stdint.h"
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
USER_INPUT_BUTTON_ACTION_RAISE,
|
||||||
|
USER_INPUT_BUTTON_ACTION_FALL,
|
||||||
|
} eUserInputButtonAction;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint16_t buttonId;
|
||||||
|
eUserInputButtonAction action;
|
||||||
|
uint32_t duration;
|
||||||
|
} tUserInputButtonEvent;
|
||||||
|
|
||||||
|
#define UserInputButtonEventIs(EVENT, BUTTON, ACTION) ((EVENT).buttonId == BUTTON && (EVENT).action == USER_INPUT_BUTTON_ACTION_##ACTION)
|
||||||
|
#define UserInputButtonEventBetween(EVENT, MIN, MAX) (((EVENT).duration > MIN ) && ((EVENT).duration < MAX))
|
||||||
|
#define UserInputButtonEventIsBetween(EVENT, BUTTON, ACTION, MIN, MAX) (UserInputButtonEventIs(EVENT, BUTTON, ACTION) && UserInputButtonEventBetween(EVENT, MIN, MAX))
|
||||||
|
|
||||||
|
|
||||||
|
#endif //UVEOS_ON_NATION_USERINPUTBUTTONEVENT_H
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
//
|
||||||
|
// Created by xemon on 16.11.22.
|
||||||
|
//
|
||||||
|
#include "UserInputButtonEvent.h"
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"dep": [
|
||||||
|
],
|
||||||
|
"cmake": {
|
||||||
|
"inc_dirs": [
|
||||||
|
"Inc"
|
||||||
|
],
|
||||||
|
"srcs": [
|
||||||
|
"Src/**.c"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue