Skip to content

Commit 62be35c

Browse files
committed
Merge branch 'feature/wifi_check_mac_when_cal_phy' into 'master'
Added two functions in PHY API for disable interrupts and add rfcal data checking to PHY See merge request !1840
2 parents c73ea7a + 1bc87e9 commit 62be35c

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

components/esp32/lib

Submodule lib updated 2 files

components/esp32/phy_init.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
#include "nvs_flash.h"
3333
#include "sdkconfig.h"
3434

35+
#include "freertos/FreeRTOS.h"
36+
#include "freertos/portmacro.h"
3537
#include "phy.h"
3638
#include "phy_init_data.h"
3739
#include "esp_coexist.h"
@@ -44,6 +46,16 @@ static int s_phy_rf_init_count = 0;
4446

4547
static _lock_t s_phy_rf_init_lock;
4648

49+
uint32_t phy_enter_critical(void)
50+
{
51+
return portENTER_CRITICAL_NESTED();
52+
}
53+
54+
void phy_exit_critical(uint32_t level)
55+
{
56+
portEXIT_CRITICAL_NESTED(level);
57+
}
58+
4759
esp_err_t esp_phy_rf_init(const esp_phy_init_data_t* init_data,
4860
esp_phy_calibration_mode_t mode, esp_phy_calibration_data_t* calibration_data)
4961
{
@@ -56,6 +68,11 @@ esp_err_t esp_phy_rf_init(const esp_phy_init_data_t* init_data,
5668
ESP_LOGV(TAG, "register_chipv7_phy, init_data=%p, cal_data=%p, mode=%d",
5769
init_data, calibration_data, mode);
5870
phy_set_wifi_mode_only(0);
71+
if (calibration_data != NULL) {
72+
uint8_t mac[6];
73+
esp_efuse_mac_get_default(mac);
74+
memcpy(&calibration_data->opaque[4], mac, 6);
75+
}
5976
register_chipv7_phy(init_data, calibration_data, mode);
6077
coex_bt_high_prio();
6178
} else {

0 commit comments

Comments
 (0)