Skip to content

Commit

Permalink
fix: fixes #587
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleRus committed Feb 4, 2024
1 parent 1aed534 commit 6a4aec9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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

0 comments on commit 6a4aec9

Please sign in to comment.