mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
feat(phy): add check for required clock bits during phy enable
This commit is contained in:
@@ -45,6 +45,12 @@
|
||||
#include "esp_private/sleep_modem.h"
|
||||
#endif
|
||||
#include "hal/efuse_hal.h"
|
||||
#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 SOC_PM_MODEM_RETENTION_BY_REGDMA
|
||||
#include "esp_private/sleep_retention.h"
|
||||
@@ -297,6 +303,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;
|
||||
|
||||
@@ -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