mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
feat(phy): add check for required clock bits during phy enable
This commit is contained in:
@@ -53,6 +53,12 @@
|
||||
#if SOC_PM_MODEM_RETENTION_BY_REGDMA
|
||||
#include "esp_private/sleep_retention.h"
|
||||
#endif
|
||||
#include "phy_init_deps.h"
|
||||
|
||||
#ifndef PHY_INIT_MODEM_CLOCK_REQUIRED_BITS
|
||||
#warning "PHY_INIT_MODEM_CLOCK_REQUIRED_BITS not defined; using default value 0"
|
||||
#define PHY_INIT_MODEM_CLOCK_REQUIRED_BITS 0
|
||||
#endif
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
extern wifi_mac_time_update_cb_t s_wifi_mac_time_update_cb;
|
||||
@@ -320,6 +326,7 @@ void esp_phy_enable(esp_phy_modem_t modem)
|
||||
#endif
|
||||
esp_phy_common_clock_enable();
|
||||
phy_module_enable();
|
||||
assert(phy_module_has_clock_bits(PHY_INIT_MODEM_CLOCK_REQUIRED_BITS));
|
||||
if (s_is_phy_calibrated == false) {
|
||||
esp_phy_load_cal_and_init();
|
||||
s_is_phy_calibrated = true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -14,6 +14,12 @@
|
||||
#if SOC_MODEM_CLOCK_IS_INDEPENDENT
|
||||
#include "esp_private/esp_modem_clock.h"
|
||||
#endif
|
||||
#include "phy_init_deps.h"
|
||||
|
||||
#ifndef PHY_INIT_MODEM_CLOCK_REQUIRED_BITS
|
||||
#warning "PHY_INIT_MODEM_CLOCK_REQUIRED_BITS not defined; using default value 0"
|
||||
#define PHY_INIT_MODEM_CLOCK_REQUIRED_BITS 0
|
||||
#endif
|
||||
|
||||
#define PHY_ENABLE_VERSION_PRINT 1
|
||||
|
||||
@@ -108,6 +114,7 @@ void esp_phy_enable(esp_phy_modem_t modem)
|
||||
modem_clock_module_enable(PERIPH_PHY_MODULE);
|
||||
#endif
|
||||
phy_module_enable();
|
||||
assert(phy_module_has_clock_bits(PHY_INIT_MODEM_CLOCK_REQUIRED_BITS));
|
||||
if (!s_phy_is_enabled) {
|
||||
register_chipv7_phy(NULL, NULL, PHY_RF_CAL_FULL);
|
||||
phy_version_print();
|
||||
|
||||
Reference in New Issue
Block a user