mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Merge branch 'integration' into memory_api
This commit is contained in:
		| @@ -11,8 +11,6 @@ | |||||||
| #include <esp_chip_info.h> | #include <esp_chip_info.h> | ||||||
| #include <esp_partition.h> | #include <esp_partition.h> | ||||||
|  |  | ||||||
| #include <map> |  | ||||||
|  |  | ||||||
| #ifdef USE_ARDUINO | #ifdef USE_ARDUINO | ||||||
| #include <Esp.h> | #include <Esp.h> | ||||||
| #endif | #endif | ||||||
| @@ -125,7 +123,12 @@ void DebugComponent::log_partition_info_() { | |||||||
|  |  | ||||||
| uint32_t DebugComponent::get_free_heap_() { return heap_caps_get_free_size(MALLOC_CAP_INTERNAL); } | uint32_t DebugComponent::get_free_heap_() { return heap_caps_get_free_size(MALLOC_CAP_INTERNAL); } | ||||||
|  |  | ||||||
| static const std::map<int, const char *> CHIP_FEATURES = { | struct ChipFeature { | ||||||
|  |   int bit; | ||||||
|  |   const char *name; | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | static constexpr ChipFeature CHIP_FEATURES[] = { | ||||||
|     {CHIP_FEATURE_BLE, "BLE"}, |     {CHIP_FEATURE_BLE, "BLE"}, | ||||||
|     {CHIP_FEATURE_BT, "BT"}, |     {CHIP_FEATURE_BT, "BT"}, | ||||||
|     {CHIP_FEATURE_EMB_FLASH, "EMB Flash"}, |     {CHIP_FEATURE_EMB_FLASH, "EMB Flash"}, | ||||||
| @@ -170,11 +173,13 @@ void DebugComponent::get_device_info_(std::string &device_info) { | |||||||
|   esp_chip_info(&info); |   esp_chip_info(&info); | ||||||
|   const char *model = ESPHOME_VARIANT; |   const char *model = ESPHOME_VARIANT; | ||||||
|   std::string features; |   std::string features; | ||||||
|   for (auto feature : CHIP_FEATURES) { |  | ||||||
|     if (info.features & feature.first) { |   // Check each known feature bit | ||||||
|       features += feature.second; |   for (const auto &feature : CHIP_FEATURES) { | ||||||
|  |     if (info.features & feature.bit) { | ||||||
|  |       features += feature.name; | ||||||
|       features += ", "; |       features += ", "; | ||||||
|       info.features &= ~feature.first; |       info.features &= ~feature.bit; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   if (info.features != 0) |   if (info.features != 0) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user