Просмотр исходного кода

efuse: fix esp_read_mac on esp32h2

zhangwenxu 2 лет назад
Родитель
Сommit
c07ec73201

+ 3 - 3
components/esp_hw_support/mac_addr.c

@@ -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

+ 15 - 2
components/esp_hw_support/port/esp32h2/Kconfig.mac

@@ -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