mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 06:33:51 +00:00 
			
		
		
		
	[wifi] Fix error message when no custom MAC is set (#7515)
This commit is contained in:
		| @@ -44,9 +44,7 @@ | ||||
| #endif | ||||
| #ifdef USE_ESP32 | ||||
| #include "esp32/rom/crc.h" | ||||
| #endif | ||||
|  | ||||
| #if defined(CONFIG_SOC_IEEE802154_SUPPORTED) || defined(USE_ESP32_IGNORE_EFUSE_MAC_CRC) | ||||
| #include "esp_efuse.h" | ||||
| #include "esp_efuse_table.h" | ||||
| #endif | ||||
| @@ -713,10 +711,11 @@ void set_mac_address(uint8_t *mac) { esp_base_mac_addr_set(mac); } | ||||
| bool has_custom_mac_address() { | ||||
| #ifdef USE_ESP32 | ||||
|   uint8_t mac[6]; | ||||
| #if defined(CONFIG_SOC_IEEE802154_SUPPORTED) || defined(USE_ESP32_IGNORE_EFUSE_MAC_CRC) | ||||
|   return (esp_efuse_read_field_blob(ESP_EFUSE_MAC_CUSTOM, mac, 48) == ESP_OK) && mac_address_is_valid(mac); | ||||
|   // do not use 'esp_efuse_mac_get_custom(mac)' because it drops an error in the logs whenever it fails | ||||
| #ifndef USE_ESP32_VARIANT_ESP32 | ||||
|   return (esp_efuse_read_field_blob(ESP_EFUSE_USER_DATA_MAC_CUSTOM, mac, 48) == ESP_OK) && mac_address_is_valid(mac); | ||||
| #else | ||||
|   return (esp_efuse_mac_get_custom(mac) == ESP_OK) && mac_address_is_valid(mac); | ||||
|   return (esp_efuse_read_field_blob(ESP_EFUSE_MAC_CUSTOM, mac, 48) == ESP_OK) && mac_address_is_valid(mac); | ||||
| #endif | ||||
| #else | ||||
|   return false; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user