Skip to content

Add 120Mhz cpu frequency option to setCpuFrequencyMhz() #8956

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

Merged
merged 2 commits into from
Dec 5, 2023
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
2 changes: 2 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ esp32c6.menu.PartitionScheme.custom.upload.maximum_size=16777216

esp32c6.menu.CPUFreq.160=160MHz (WiFi)
esp32c6.menu.CPUFreq.160.build.f_cpu=160000000L
esp32c6.menu.CPUFreq.120=120MHz (WiFi)
esp32c6.menu.CPUFreq.120.build.f_cpu=120000000L
esp32c6.menu.CPUFreq.80=80MHz (WiFi)
esp32c6.menu.CPUFreq.80.build.f_cpu=80000000L
esp32c6.menu.CPUFreq.40=40MHz
Expand Down
6 changes: 3 additions & 3 deletions cores/esp32/esp32-hal-cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz){
}
#endif
#ifndef CONFIG_IDF_TARGET_ESP32H2
if(cpu_freq_mhz > xtal && cpu_freq_mhz != 240 && cpu_freq_mhz != 160 && cpu_freq_mhz != 80){
if(cpu_freq_mhz > xtal && cpu_freq_mhz != 240 && cpu_freq_mhz != 160 && cpu_freq_mhz != 120 && cpu_freq_mhz != 80){
if(xtal >= RTC_XTAL_FREQ_40M){
log_e("Bad frequency: %u MHz! Options are: 240, 160, 80, %u, %u and %u MHz", cpu_freq_mhz, xtal, xtal/2, xtal/4);
log_e("Bad frequency: %u MHz! Options are: 240, 160, 120, 80, %u, %u and %u MHz", cpu_freq_mhz, xtal, xtal/2, xtal/4);
} else {
log_e("Bad frequency: %u MHz! Options are: 240, 160, 80, %u and %u MHz", cpu_freq_mhz, xtal, xtal/2);
log_e("Bad frequency: %u MHz! Options are: 240, 160, 120, 80, %u and %u MHz", cpu_freq_mhz, xtal, xtal/2);
}
return false;
}
Expand Down