fix bug lenght timer
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
#include "input_handler.h"
|
#include "input_handler.h"
|
||||||
#include "timer_counter.h"
|
#include "timer_counter.h"
|
||||||
|
|
||||||
|
typedef void (*ButtonRoutine_t)(ButtonKey_t *);
|
||||||
|
|
||||||
const ButtonRoutine_t button_routine[MAX_STATE];
|
const ButtonRoutine_t button_routine[MAX_STATE];
|
||||||
|
|
||||||
void buttonHandler(ButtonKey_t *key)
|
void buttonHandler(ButtonKey_t *key)
|
||||||
|
|||||||
@@ -33,14 +33,12 @@ struct ButtonKey
|
|||||||
|
|
||||||
GPIO_PinState active_state; // The state when the button is active (pressed)
|
GPIO_PinState active_state; // The state when the button is active (pressed)
|
||||||
|
|
||||||
uint8_t last_tick; // Last remembered time before steps
|
uint16_t last_tick; // Last remembered time before steps
|
||||||
uint8_t timer_debounce_on; // Fixed, settable time for debounce timer
|
uint16_t timer_debounce_on; // Fixed, settable time for debounce timer
|
||||||
uint8_t timer_debounce_off; // Fixed, settable time for debounce timer
|
uint16_t timer_debounce_off; // Fixed, settable time for debounce timer
|
||||||
|
|
||||||
buttonPressed_t buttonReleased; // A callback for button released
|
buttonPressed_t buttonReleased; // A callback for button released
|
||||||
buttonPressed_t buttonPressed; // A callback for button pressed
|
buttonPressed_t buttonPressed; // A callback for button pressed
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (*ButtonRoutine_t)(ButtonKey_t *);
|
|
||||||
|
|
||||||
void buttonHandler(ButtonKey_t *key);
|
void buttonHandler(ButtonKey_t *key);
|
||||||
Reference in New Issue
Block a user