efuse: fix esp_read_mac on esp32h2

This commit is contained in:
zhangwenxu 2023-03-01 11:25:38 +08:00
parent bbac0c81f2
commit c07ec73201
2 changed files with 18 additions and 5 deletions

View File

@ -332,10 +332,10 @@ static esp_err_t generate_mac(uint8_t *mac, uint8_t *base_mac_addr, esp_mac_type
case ESP_MAC_BT:
#if CONFIG_ESP_MAC_ADDR_UNIVERSE_BT
memcpy(mac, base_mac_addr, 6);
#if !CONFIG_IDF_TARGET_ESP32H4
// esp32h4 chips do not have wifi module, so the mac address do not need to add the BT offset
#if SOC_WIFI_SUPPORTED
// If the chips do not have wifi module, the mac address do not need to add the BT offset
mac[5] += MAC_ADDR_UNIVERSE_BT_OFFSET;
#endif //!CONFIG_IDF_TARGET_ESP32H4
#endif //SOC_WIFI_SUPPORTED
#else
return ESP_ERR_NOT_SUPPORTED;
#endif // CONFIG_ESP_MAC_ADDR_UNIVERSE_BT

View File

@ -1,5 +1,18 @@
# ESP32H2-TODO: MAC support
choice ESP32H2_UNIVERSAL_MAC_ADDRESSES
bool "Number of universally administered (by IEEE) MAC address"
default ESP32H2_UNIVERSAL_MAC_ADDRESSES_TWO
help
Configure the number of universally administered (by IEEE) MAC addresses.
During initialization, MAC addresses for each network interface are generated or derived from a
single base MAC address.
config ESP32H2_UNIVERSAL_MAC_ADDRESSES_TWO
bool "Two"
select ESP_MAC_UNIVERSAL_MAC_ADDRESSES_TWO
select ESP_MAC_ADDR_UNIVERSE_IEEE802154
select ESP_MAC_ADDR_UNIVERSE_BT
endchoice
config ESP32H2_UNIVERSAL_MAC_ADDRESSES
int
default 2 if ESP32H2_UNIVERSAL_MAC_ADDRESSES_TWO