mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/fix_build_warring_v4.4' into 'release/v4.4'
esp_phy: fix build warning(v4.4) See merge request espressif/esp-idf!17840
This commit is contained in:
commit
ef7ce17dbd
@ -20,8 +20,8 @@ extern "C" {
|
|||||||
|
|
||||||
// define the lowest tx power as LOWEST_PHY_TX_POWER
|
// define the lowest tx power as LOWEST_PHY_TX_POWER
|
||||||
#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52)
|
#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52)
|
||||||
#define PHY_TX_POWER_OFFSET 44
|
#define PHY_TX_POWER_OFFSET 2
|
||||||
#define PHY_TX_POWER_NUM 5
|
#define PHY_TX_POWER_NUM 14
|
||||||
|
|
||||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||||
#define PHY_CRC_ALGORITHM 1
|
#define PHY_CRC_ALGORITHM 1
|
||||||
|
@ -20,8 +20,8 @@ extern "C" {
|
|||||||
|
|
||||||
// define the lowest tx power as LOWEST_PHY_TX_POWER
|
// define the lowest tx power as LOWEST_PHY_TX_POWER
|
||||||
#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52)
|
#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52)
|
||||||
#define PHY_TX_POWER_OFFSET 44
|
#define PHY_TX_POWER_OFFSET 2
|
||||||
#define PHY_TX_POWER_NUM 5
|
#define PHY_TX_POWER_NUM 14
|
||||||
|
|
||||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||||
#define PHY_CRC_ALGORITHM 1
|
#define PHY_CRC_ALGORITHM 1
|
||||||
|
@ -20,8 +20,8 @@ extern "C" {
|
|||||||
|
|
||||||
// define the lowest tx power as LOWEST_PHY_TX_POWER
|
// define the lowest tx power as LOWEST_PHY_TX_POWER
|
||||||
#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52)
|
#define PHY_TX_POWER_LOWEST LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 52)
|
||||||
#define PHY_TX_POWER_OFFSET 44
|
#define PHY_TX_POWER_OFFSET 2
|
||||||
#define PHY_TX_POWER_NUM 5
|
#define PHY_TX_POWER_NUM 14
|
||||||
|
|
||||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||||
#define PHY_CRC_ALGORITHM 1
|
#define PHY_CRC_ALGORITHM 1
|
||||||
|
@ -349,8 +349,6 @@ IRAM_ATTR void esp_mac_bb_power_down(void)
|
|||||||
|
|
||||||
const esp_phy_init_data_t* esp_phy_get_init_data(void)
|
const esp_phy_init_data_t* esp_phy_get_init_data(void)
|
||||||
{
|
{
|
||||||
esp_err_t err = ESP_OK;
|
|
||||||
const esp_partition_t* partition = NULL;
|
|
||||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED
|
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED
|
||||||
size_t init_data_store_length = sizeof(phy_init_magic_pre) +
|
size_t init_data_store_length = sizeof(phy_init_magic_pre) +
|
||||||
sizeof(esp_phy_init_data_t) + sizeof(phy_init_magic_post);
|
sizeof(esp_phy_init_data_t) + sizeof(phy_init_magic_post);
|
||||||
@ -362,7 +360,7 @@ const esp_phy_init_data_t* esp_phy_get_init_data(void)
|
|||||||
memcpy(init_data_store, multi_phy_init_data_bin_start, init_data_store_length);
|
memcpy(init_data_store, multi_phy_init_data_bin_start, init_data_store_length);
|
||||||
ESP_LOGI(TAG, "loading embedded multiple PHY init data");
|
ESP_LOGI(TAG, "loading embedded multiple PHY init data");
|
||||||
#else
|
#else
|
||||||
partition = esp_partition_find_first(
|
const esp_partition_t* partition = esp_partition_find_first(
|
||||||
ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_PHY, NULL);
|
ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_PHY, NULL);
|
||||||
if (partition == NULL) {
|
if (partition == NULL) {
|
||||||
ESP_LOGE(TAG, "PHY data partition not found");
|
ESP_LOGE(TAG, "PHY data partition not found");
|
||||||
@ -377,7 +375,7 @@ const esp_phy_init_data_t* esp_phy_get_init_data(void)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
// read phy data from flash
|
// read phy data from flash
|
||||||
err = esp_partition_read(partition, 0, init_data_store, init_data_store_length);
|
esp_err_t err = esp_partition_read(partition, 0, init_data_store, init_data_store_length);
|
||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
ESP_LOGE(TAG, "failed to read PHY data partition (0x%x)", err);
|
ESP_LOGE(TAG, "failed to read PHY data partition (0x%x)", err);
|
||||||
free(init_data_store);
|
free(init_data_store);
|
||||||
@ -388,6 +386,11 @@ const esp_phy_init_data_t* esp_phy_get_init_data(void)
|
|||||||
if (memcmp(init_data_store, PHY_INIT_MAGIC, sizeof(phy_init_magic_pre)) != 0 ||
|
if (memcmp(init_data_store, PHY_INIT_MAGIC, sizeof(phy_init_magic_pre)) != 0 ||
|
||||||
memcmp(init_data_store + init_data_store_length - sizeof(phy_init_magic_post),
|
memcmp(init_data_store + init_data_store_length - sizeof(phy_init_magic_post),
|
||||||
PHY_INIT_MAGIC, sizeof(phy_init_magic_post)) != 0) {
|
PHY_INIT_MAGIC, sizeof(phy_init_magic_post)) != 0) {
|
||||||
|
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED
|
||||||
|
ESP_LOGE(TAG, "failed to validate embedded PHY init data");
|
||||||
|
free(init_data_store);
|
||||||
|
return NULL;
|
||||||
|
#else
|
||||||
#ifndef CONFIG_ESP_PHY_DEFAULT_INIT_IF_INVALID
|
#ifndef CONFIG_ESP_PHY_DEFAULT_INIT_IF_INVALID
|
||||||
ESP_LOGE(TAG, "failed to validate PHY data partition");
|
ESP_LOGE(TAG, "failed to validate PHY data partition");
|
||||||
free(init_data_store);
|
free(init_data_store);
|
||||||
@ -414,6 +417,7 @@ const esp_phy_init_data_t* esp_phy_get_init_data(void)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif // CONFIG_ESP_PHY_DEFAULT_INIT_IF_INVALID
|
#endif // CONFIG_ESP_PHY_DEFAULT_INIT_IF_INVALID
|
||||||
|
#endif // CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN_EMBED
|
||||||
}
|
}
|
||||||
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
#if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN
|
||||||
if ((*(init_data_store + (sizeof(phy_init_magic_pre) + PHY_SUPPORT_MULTIPLE_BIN_OFFSET)))) {
|
if ((*(init_data_store + (sizeof(phy_init_magic_pre) + PHY_SUPPORT_MULTIPLE_BIN_OFFSET)))) {
|
||||||
@ -603,7 +607,6 @@ static esp_err_t store_cal_data_to_nvs_handle(nvs_handle_t handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_ESP_PHY_REDUCE_TX_POWER
|
#if CONFIG_ESP_PHY_REDUCE_TX_POWER
|
||||||
// TODO: fix the esp_phy_reduce_tx_power unused warning for esp32s2 - IDF-759
|
|
||||||
static void __attribute((unused)) esp_phy_reduce_tx_power(esp_phy_init_data_t* init_data)
|
static void __attribute((unused)) esp_phy_reduce_tx_power(esp_phy_init_data_t* init_data)
|
||||||
{
|
{
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user