mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-05-22 09:37:00 +08:00
fix(startup): Fix initialize clock error when CPU starts up
This commit is contained in:
@ -394,6 +394,7 @@ void esp_phy_init_clk(void)
|
|||||||
#else
|
#else
|
||||||
const uint32_t uart_baudrate = 74880; // ROM default baudrate
|
const uint32_t uart_baudrate = 74880; // ROM default baudrate
|
||||||
#endif
|
#endif
|
||||||
|
extern int rtc_init(void);
|
||||||
|
|
||||||
init_data = esp_phy_get_init_data();
|
init_data = esp_phy_get_init_data();
|
||||||
if (init_data == NULL) {
|
if (init_data == NULL) {
|
||||||
@ -408,6 +409,7 @@ void esp_phy_init_clk(void)
|
|||||||
uart_tx_wait_idle(1);
|
uart_tx_wait_idle(1);
|
||||||
uart_div_modify(1, UART_CLK_FREQ / uart_baudrate);
|
uart_div_modify(1, UART_CLK_FREQ / uart_baudrate);
|
||||||
|
|
||||||
|
rtc_init();
|
||||||
rtc_init_clk(buf);
|
rtc_init_clk(buf);
|
||||||
|
|
||||||
esp_phy_release_init_data(init_data);
|
esp_phy_release_init_data(init_data);
|
||||||
|
@ -42,7 +42,6 @@
|
|||||||
extern esp_err_t esp_pthread_init(void);
|
extern esp_err_t esp_pthread_init(void);
|
||||||
extern void chip_boot(void);
|
extern void chip_boot(void);
|
||||||
extern int base_gpio_init(void);
|
extern int base_gpio_init(void);
|
||||||
extern int rtc_init(void);
|
|
||||||
|
|
||||||
static inline int should_load(uint32_t load_addr)
|
static inline int should_load(uint32_t load_addr)
|
||||||
{
|
{
|
||||||
@ -71,7 +70,6 @@ static void user_init_entry(void *param)
|
|||||||
for (func = &__init_array_start; func < &__init_array_end; func++)
|
for (func = &__init_array_start; func < &__init_array_end; func++)
|
||||||
func[0]();
|
func[0]();
|
||||||
|
|
||||||
rtc_init();
|
|
||||||
esp_phy_init_clk();
|
esp_phy_init_clk();
|
||||||
assert(base_gpio_init() == 0);
|
assert(base_gpio_init() == 0);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user