feat(esp8266): Add option to configurate CPU frequncy to 160MHz before "app_main"

This commit is contained in:
dongheng
2019-03-05 11:50:33 +08:00
parent c726af8fda
commit 721a161bc1
2 changed files with 21 additions and 0 deletions

View File

@ -1,5 +1,22 @@
menu "ESP8266-specific"
choice ESP8266_DEFAULT_CPU_FREQ_MHZ
prompt "CPU frequency"
default ESP8266_DEFAULT_CPU_FREQ_80
help
CPU frequency to be set on application startup.
config ESP8266_DEFAULT_CPU_FREQ_80
bool "80 MHz"
config ESP8266_DEFAULT_CPU_FREQ_160
bool "160 MHz"
endchoice
config ESP8266_DEFAULT_CPU_FREQ_MHZ
int
default 80 if ESP8266_DEFAULT_CPU_FREQ_80
default 160 if ESP8266_DEFAULT_CPU_FREQ_160
choice NEWLIB_STDOUT_LINE_ENDING
prompt "Line ending for UART output"
default NEWLIB_STDOUT_LINE_ENDING_CRLF

View File

@ -81,6 +81,10 @@ static void user_init_entry(void *param)
assert(esp_pthread_init() == 0);
#endif
#ifdef CONFIG_ESP8266_DEFAULT_CPU_FREQ_160
rtc_clk_cpu_freq_set(RTC_CPU_FREQ_160M);
#endif
app_main();
wifi_task_delete(NULL);