mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
fix(esp_phy): fix pll track corner case
This commit is contained in:
parent
3de31924ac
commit
b96064a740
@ -168,6 +168,12 @@ void phy_clr_modem_flag(esp_phy_modem_t modem);
|
||||
*
|
||||
*/
|
||||
esp_phy_modem_t phy_get_modem_flag(void);
|
||||
|
||||
/**
|
||||
* @brief Get the PHY lock, only used in esp_phy, the user should not use this function.
|
||||
*
|
||||
*/
|
||||
_lock_t phy_get_lock(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "esp_timer.h"
|
||||
#include "esp_phy_init.h"
|
||||
#include "esp_private/phy.h"
|
||||
#include <stdint.h>
|
||||
|
||||
static volatile uint16_t s_phy_modem_flag = 0;
|
||||
@ -27,7 +28,7 @@ bool phy_enabled_modem_contains(esp_phy_modem_t modem)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void phy_track_pll_timer_callback(void* arg)
|
||||
static void phy_track_pll(void)
|
||||
{
|
||||
bool wifi_track_pll = false;
|
||||
bool ble_154_track_pll = false;
|
||||
@ -44,7 +45,17 @@ static void phy_track_pll_timer_callback(void* arg)
|
||||
s_bt_154_prev_timestamp = esp_timer_get_time();
|
||||
}
|
||||
#endif
|
||||
phy_param_track_tot(wifi_track_pll, ble_154_track_pll);
|
||||
if (wifi_track_pll || ble_154_track_pll) {
|
||||
phy_param_track_tot(wifi_track_pll, ble_154_track_pll);
|
||||
}
|
||||
}
|
||||
|
||||
static void phy_track_pll_timer_callback(void* arg)
|
||||
{
|
||||
_lock_t phy_lock = phy_get_lock();
|
||||
_lock_acquire(&phy_lock);
|
||||
phy_track_pll();
|
||||
_lock_release(&phy_lock);
|
||||
}
|
||||
|
||||
void phy_track_pll_init(void)
|
||||
@ -60,7 +71,7 @@ void phy_track_pll_init(void)
|
||||
need_track_pll = need_track_pll || ((esp_timer_get_time() - s_bt_154_prev_timestamp) > PHY_TRACK_PLL_PERIOD_IN_US);
|
||||
#endif
|
||||
if (need_track_pll) {
|
||||
phy_track_pll_timer_callback((void* )0);
|
||||
phy_track_pll();
|
||||
}
|
||||
|
||||
const esp_timer_create_args_t phy_track_pll_timer_args = {
|
||||
|
@ -1113,3 +1113,8 @@ esp_err_t esp_phy_update_country_info(const char *country)
|
||||
|
||||
void esp_wifi_power_domain_on(void) __attribute__((alias("esp_wifi_bt_power_domain_on")));
|
||||
void esp_wifi_power_domain_off(void) __attribute__((alias("esp_wifi_bt_power_domain_off")));
|
||||
|
||||
_lock_t phy_get_lock(void)
|
||||
{
|
||||
return s_phy_access_lock;
|
||||
}
|
||||
|
@ -89,3 +89,8 @@ void esp_phy_disable(esp_phy_modem_t modem)
|
||||
phy_clr_modem_flag(modem);
|
||||
_lock_release(&s_phy_access_lock);
|
||||
}
|
||||
|
||||
_lock_t phy_get_lock(void)
|
||||
{
|
||||
return s_phy_access_lock;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user