|
|
|
@ -8,8 +8,8 @@ const int pushPin = 5; |
|
|
|
|
const int wheelPin1 = 18; |
|
|
|
|
const int wheelPin2 = 23; |
|
|
|
|
|
|
|
|
|
#define DEBOUNCE_WHEEL_MS 3 |
|
|
|
|
#define DEBOUNCE_BTN_MS 10 |
|
|
|
|
#define DEBOUNCE_WHEEL_MS 2 |
|
|
|
|
#define DEBOUNCE_BTN_MS 5 |
|
|
|
|
|
|
|
|
|
static void debounce_service(void *arg); |
|
|
|
|
static TaskHandle_t hDebouncer; |
|
|
|
@ -36,9 +36,9 @@ static void __attribute__((noreturn)) debounce_service(void *arg) { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
struct debo state[3] = { |
|
|
|
|
{.debo_time = pdMS_TO_TICKS(DEBOUNCE_BTN_MS)}, // push
|
|
|
|
|
{.debo_time = pdMS_TO_TICKS(DEBOUNCE_WHEEL_MS)}, // wheel input 1
|
|
|
|
|
{.debo_time = pdMS_TO_TICKS(DEBOUNCE_WHEEL_MS)} // wheel input 2
|
|
|
|
|
{.debo_time = pdMS_TO_TICKS(DEBOUNCE_BTN_MS)}, // push
|
|
|
|
|
{.debo_time = pdMS_TO_TICKS(DEBOUNCE_WHEEL_MS), .state=1}, // wheel input 1
|
|
|
|
|
{.debo_time = pdMS_TO_TICKS(DEBOUNCE_WHEEL_MS), .state=1} // wheel input 2
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
while (1) { |
|
|
|
|