change(example/power_save): modify to support dfs min frequency select to 48 MHz xtal

This commit is contained in:
Li Shuai 2024-06-27 11:54:57 +08:00
parent 1604cef916
commit eeb55c3f04

View File

@ -89,7 +89,7 @@ menu "Example Configuration"
depends on !IDF_TARGET_ESP32C2 depends on !IDF_TARGET_ESP32C2
config EXAMPLE_MAX_CPU_FREQ_240 config EXAMPLE_MAX_CPU_FREQ_240
bool "240 MHz" bool "240 MHz"
depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C5
endchoice endchoice
config EXAMPLE_MAX_CPU_FREQ_MHZ config EXAMPLE_MAX_CPU_FREQ_MHZ
@ -107,27 +107,39 @@ menu "Example Configuration"
Minimum CPU frequency to use for dynamic frequency scaling. Minimum CPU frequency to use for dynamic frequency scaling.
Should be set to XTAL frequency or XTAL frequency divided by integer. Should be set to XTAL frequency or XTAL frequency divided by integer.
config EXAMPLE_MIN_CPU_FREQ_48M
bool "48 MHz (use with 48MHz XTAL)"
depends on XTAL_FREQ_48 || (XTAL_FREQ_AUTO && IDF_TARGET_ESP32C5)
config EXAMPLE_MIN_CPU_FREQ_40M config EXAMPLE_MIN_CPU_FREQ_40M
bool "40 MHz (use with 40MHz XTAL)" bool "40 MHz (use with 40MHz XTAL)"
depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO
config EXAMPLE_MIN_CPU_FREQ_24M
bool "24 MHz (use with 48MHz XTAL)"
depends on XTAL_FREQ_48 || (XTAL_FREQ_AUTO && IDF_TARGET_ESP32C5)
config EXAMPLE_MIN_CPU_FREQ_20M config EXAMPLE_MIN_CPU_FREQ_20M
bool "20 MHz (use with 40MHz XTAL)" bool "20 MHz (use with 40MHz XTAL)"
depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO
config EXAMPLE_MIN_CPU_FREQ_12M
bool "12 MHz (use with 48MHz XTAL)"
depends on XTAL_FREQ_48 || (XTAL_FREQ_AUTO && IDF_TARGET_ESP32C5)
config EXAMPLE_MIN_CPU_FREQ_10M config EXAMPLE_MIN_CPU_FREQ_10M
bool "10 MHz (use with 40MHz XTAL)" bool "10 MHz (use with 40MHz XTAL)"
depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO depends on XTAL_FREQ_40 || XTAL_FREQ_AUTO
config EXAMPLE_MIN_CPU_FREQ_26M config EXAMPLE_MIN_CPU_FREQ_26M
bool "26 MHz (use with 26MHz XTAL)" bool "26 MHz (use with 26MHz XTAL)"
depends on XTAL_FREQ_26 || XTAL_FREQ_AUTO depends on XTAL_FREQ_26 || (XTAL_FREQ_AUTO && IDF_TARGET_ESP32C2)
config EXAMPLE_MIN_CPU_FREQ_13M config EXAMPLE_MIN_CPU_FREQ_13M
bool "13 MHz (use with 26MHz XTAL)" bool "13 MHz (use with 26MHz XTAL)"
depends on XTAL_FREQ_26 || XTAL_FREQ_AUTO depends on XTAL_FREQ_26 || (XTAL_FREQ_AUTO && IDF_TARGET_ESP32C2)
endchoice endchoice
config EXAMPLE_MIN_CPU_FREQ_MHZ config EXAMPLE_MIN_CPU_FREQ_MHZ
int int
default 48 if EXAMPLE_MIN_CPU_FREQ_48M
default 40 if EXAMPLE_MIN_CPU_FREQ_40M default 40 if EXAMPLE_MIN_CPU_FREQ_40M
default 24 if EXAMPLE_MIN_CPU_FREQ_24M
default 20 if EXAMPLE_MIN_CPU_FREQ_20M default 20 if EXAMPLE_MIN_CPU_FREQ_20M
default 12 if EXAMPLE_MIN_CPU_FREQ_12M
default 10 if EXAMPLE_MIN_CPU_FREQ_10M default 10 if EXAMPLE_MIN_CPU_FREQ_10M
default 26 if EXAMPLE_MIN_CPU_FREQ_26M default 26 if EXAMPLE_MIN_CPU_FREQ_26M
default 13 if EXAMPLE_MIN_CPU_FREQ_13M default 13 if EXAMPLE_MIN_CPU_FREQ_13M