Skip to content

Commit

Permalink
fix double click, long press and button press
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ-Koenig committed May 3, 2024
1 parent bb83b6e commit 88351ba
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions Software/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "services/board.h"
#include "services/display.h"
#include "services/encoder.h"
#include "utils/StrokeEngineHelper.h"

/*
* ██████╗ ███████╗███████╗███╗ ███╗
Expand Down Expand Up @@ -92,12 +91,9 @@ void loop() {
}

unsigned long pressTime = riseTime - fallTime;
ESP_LOGD("Encoder", "Press time: %d, %d", pressTime,
millis() - lastPressed);

// detect if a double click occurred
if (millis() - lastPressed < 300) {
ESP_LOGD("Encoder", "Double Press");
ossm->sm->process_event(DoublePress{});
} else {
ossm->sm->process_event(ButtonPress{});
Expand Down

0 comments on commit 88351ba

Please sign in to comment.