Input: refactoring, platform agnostic key configuration.

Update input usage across project. Minor queue usage fixes and tick timings. (#330)
This commit is contained in:
あく
2021-02-10 11:56:05 +03:00
committed by GitHub
parent 5dbe2983aa
commit 8b94eff7f9
36 changed files with 347 additions and 334 deletions

View File

@@ -2,11 +2,28 @@
#include "main.h"
#include <furi.h>
#define DEBOUNCE_TICKS 10
#define GPIO_INPUT_PINS_COUNT 6
/* Input Related Constants */
#define INPUT_DEBOUNCE_TICKS 20
extern const GpioPin input_gpio[GPIO_INPUT_PINS_COUNT];
extern const bool input_invert[GPIO_INPUT_PINS_COUNT];
/* Input Keys */
typedef enum {
InputKeyUp,
InputKeyDown,
InputKeyRight,
InputKeyLeft,
InputKeyOk,
InputKeyBack,
} InputKey;
typedef struct {
const GPIO_TypeDef* port;
const uint16_t pin;
const InputKey key;
const bool inverted;
} InputPin;
extern const InputPin input_pins[];
extern const size_t input_pins_count;
extern const GpioPin led_gpio[3];
extern const GpioPin backlight_gpio;