add PHY init support

This commit is contained in:
Ivan Grokhotkov
2016-11-15 18:36:18 +08:00
parent a0feea8daa
commit 4db29f74a0
8 changed files with 736 additions and 1 deletions

View File

@@ -50,6 +50,7 @@
#include "esp_brownout.h"
#include "esp_int_wdt.h"
#include "esp_task_wdt.h"
#include "esp_phy_init.h"
#include "trax.h"
void start_cpu0(void) __attribute__((weak, alias("start_cpu0_default")));
@@ -187,6 +188,20 @@ void start_cpu0_default(void)
esp_ipc_init();
spi_flash_init();
#if CONFIG_ESP32_PHY_AUTO_INIT
#if CONFIG_ESP32_STORE_PHY_CALIBRATION_DATA_IN_NVS
nvs_flash_init();
#endif
esp_phy_calibration_mode_t calibration_mode = PHY_RF_CAL_PARTIAL;
if (rtc_get_reset_reason(0) == DEEPSLEEP_RESET) {
calibration_mode = PHY_RF_CAL_NONE;
}
if (esp_phy_init(calibration_mode) != ESP_OK) {
ESP_LOGD(TAG, "phy init has failed");
abort();
}
#endif
xTaskCreatePinnedToCore(&main_task, "main",
ESP_TASK_MAIN_STACK, NULL,
ESP_TASK_MAIN_PRIO, NULL, 0);