Make debounce times configurable on the fly
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include "fsl_gpio.h"
|
||||
#include "key_matrix.h"
|
||||
|
||||
uint8_t DebounceTimePress = 100, DebounceTimeRelease = 0;
|
||||
|
||||
void KeyMatrix_Init(key_matrix_t *keyMatrix)
|
||||
{
|
||||
for (key_matrix_pin_t *row = keyMatrix->rows; row < keyMatrix->rows + keyMatrix->rowNum; row++) {
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
// Macros:
|
||||
|
||||
#define MAX_KEYS_IN_MATRIX 100
|
||||
#define KEY_BOUNCE_TIME_MSEC 100
|
||||
|
||||
// Typedefs:
|
||||
|
||||
@@ -29,6 +28,10 @@
|
||||
uint8_t keyStates[MAX_KEYS_IN_MATRIX];
|
||||
} key_matrix_t;
|
||||
|
||||
// Variables:
|
||||
|
||||
extern uint8_t DebounceTimePress, DebounceTimeRelease;
|
||||
|
||||
// Functions:
|
||||
|
||||
void KeyMatrix_Init(key_matrix_t *keyMatrix);
|
||||
|
||||
Reference in New Issue
Block a user