diff --git a/esphome/components/esp32/__init__.py b/esphome/components/esp32/__init__.py index 09eabe1fa7..68653d68ff 100644 --- a/esphome/components/esp32/__init__.py +++ b/esphome/components/esp32/__init__.py @@ -302,6 +302,8 @@ async def to_code(config): ) add_idf_sdkconfig_option("CONFIG_COMPILER_OPTIMIZATION_DEFAULT", False) add_idf_sdkconfig_option("CONFIG_COMPILER_OPTIMIZATION_SIZE", True) + # Increase freertos tick speed from 100Hz to 1kHz so that delay() resolution is 1ms + add_idf_sdkconfig_option("CONFIG_FREERTOS_HZ", 1000) cg.add_platformio_option("board_build.partitions", "partitions.csv") diff --git a/sdkconfig.defaults b/sdkconfig.defaults index 6b2d6f8f2e..26db4705b8 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -8,6 +8,7 @@ CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_PARTITION_TABLE_CUSTOM=y #CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" CONFIG_PARTITION_TABLE_SINGLE_APP=n +CONFIG_FREERTOS_HZ=1000 # esp32_ble CONFIG_BT_ENABLED=y