diff --git a/components/encoder/Kconfig b/components/encoder/Kconfig index 5ef2a56c..d1990a0b 100644 --- a/components/encoder/Kconfig +++ b/components/encoder/Kconfig @@ -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" diff --git a/components/encoder/encoder.c b/components/encoder/encoder.c index 06b64e83..4be63aa4 100644 --- a/components/encoder/encoder.c +++ b/components/encoder/encoder.c @@ -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 };