Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixes #587 #604

Merged
merged 1 commit into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion components/encoder/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ menu "Rotary encoders"

config RE_INTERVAL_US
int "Polling interval, us"
default 1000
default 10000 if IDF_TARGET_ESP8266
default 1000 if !IDF_TARGET_ESP8266

config RE_BTN_DEAD_TIME_US
int "Button dead time, us"
Expand Down
4 changes: 4 additions & 0 deletions components/encoder/encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
#define BTN_PRESSED_LEVEL 1
#endif

#if defined(CONFIG_IDF_TARGET_ESP8266) && CONFIG_RE_INTERVAL_US < 10000
#error Too small CONFIG_RE_INTERVAL_US! For ESP8266 it should be >= 10000
#endif

static const char *TAG = "encoder";
static rotary_encoder_t *encs[CONFIG_RE_MAX] = { 0 };
static const int8_t valid_states[] = { 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0 };
Expand Down
Loading