diff --git a/components/esp_phy/esp32c61/include/phy_init_data.h b/components/esp_phy/esp32c61/include/phy_init_data.h index 5eba2765042..ef8c700d28f 100644 --- a/components/esp_phy/esp32c61/include/phy_init_data.h +++ b/components/esp_phy/esp32c61/include/phy_init_data.h @@ -27,8 +27,8 @@ extern "C" { #if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN #define PHY_CRC_ALGORITHM 1 #define PHY_COUNTRY_CODE_LEN 2 -#define PHY_INIT_DATA_TYPE_OFFSET 254 -#define PHY_SUPPORT_MULTIPLE_BIN_OFFSET 253 +#define PHY_INIT_DATA_TYPE_OFFSET 126 +#define PHY_SUPPORT_MULTIPLE_BIN_OFFSET 125 #endif extern const char phy_init_magic_pre[]; diff --git a/components/esp_phy/esp32s31/include/phy_init_data.h b/components/esp_phy/esp32s31/include/phy_init_data.h index e2eeb7078d4..b98f9d06a73 100644 --- a/components/esp_phy/esp32s31/include/phy_init_data.h +++ b/components/esp_phy/esp32s31/include/phy_init_data.h @@ -27,8 +27,8 @@ extern "C" { #if CONFIG_ESP_PHY_MULTIPLE_INIT_DATA_BIN #define PHY_CRC_ALGORITHM 1 #define PHY_COUNTRY_CODE_LEN 2 -#define PHY_INIT_DATA_TYPE_OFFSET 254 -#define PHY_SUPPORT_MULTIPLE_BIN_OFFSET 253 +#define PHY_INIT_DATA_TYPE_OFFSET 126 +#define PHY_SUPPORT_MULTIPLE_BIN_OFFSET 125 #endif extern const char phy_init_magic_pre[]; diff --git a/components/esp_phy/src/phy_init.c b/components/esp_phy/src/phy_init.c index 08284f04bf5..9b3043ef21a 100644 --- a/components/esp_phy/src/phy_init.c +++ b/components/esp_phy/src/phy_init.c @@ -126,6 +126,13 @@ static uint8_t s_phy_modem_init_ref = 0; extern uint8_t multi_phy_init_data_bin_start[] asm("_binary_phy_multiple_init_data_bin_start"); extern uint8_t multi_phy_init_data_bin_end[] asm("_binary_phy_multiple_init_data_bin_end"); #endif + +/* Both flags live in the last bytes of an init data entry */ +_Static_assert(PHY_INIT_DATA_TYPE_OFFSET == sizeof(esp_phy_init_data_t) - 2, + "PHY_INIT_DATA_TYPE_OFFSET does not match the PHY init data of this target"); +_Static_assert(PHY_SUPPORT_MULTIPLE_BIN_OFFSET == sizeof(esp_phy_init_data_t) - 3, + "PHY_SUPPORT_MULTIPLE_BIN_OFFSET does not match the PHY init data of this target"); + /* The following static variables are only used by Wi-Fi tasks, so they can be handled without lock */ static phy_init_data_type_t s_phy_init_data_type = 0;