Skip to content

Commit

Permalink
restyle changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pimpalemahesh authored and esp committed Dec 18, 2024
1 parent a3e478d commit 4ac601c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/platform/ESP32/ConnectivityManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ class ConnectivityManagerImpl final : public ConnectivityManager,

// ===== Members for internal use by the following friends.


friend ConnectivityManager & ConnectivityMgr(void);
friend ConnectivityManagerImpl & ConnectivityMgrImpl(void);

Expand Down
6 changes: 3 additions & 3 deletions src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ using namespace ::chip::System;
using chip::DeviceLayer::Internal::ESP32Utils;

#ifdef CONFIG_ENABLE_ESP_DIAGNOSTICS_TRACE
static int max_rssi = -100;
static int current_rssi = 1;
static int min_rssi = 0;
static int max_rssi = -100;
static int current_rssi = 1;
static int min_rssi = 0;
constexpr chip::Tracing::MetricKey kMetricWiFiMaxRSSI = "max_rssi";
constexpr chip::Tracing::MetricKey kMetricWiFiMinRSSI = "min_rssi";
#endif // CONFIG_ENABLE_ESP_DIAGNOSTICS_TRACE
Expand Down
14 changes: 6 additions & 8 deletions src/platform/ESP32/ESP32Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ using namespace chip::DeviceLayer;
using namespace chip::Tracing;

// Heap Diagnostics (internal)
constexpr MetricKey kMetricHeapInternalFree = "internal_free";
constexpr MetricKey kMetricHeapInternalMinFree = "internal_min_free";
constexpr MetricKey kMetricHeapInternalFree = "internal_free";
constexpr MetricKey kMetricHeapInternalMinFree = "internal_min_free";
constexpr MetricKey kMetricHeapInternalLargestBlock = "internal_largest_free";

// Heap Diagnostics (external)
constexpr MetricKey kMetricHeapExternalFree = "external_free";
constexpr MetricKey kMetricHeapExternalMinFree = "external_min_free";
constexpr MetricKey kMetricHeapExternalFree = "external_free";
constexpr MetricKey kMetricHeapExternalMinFree = "external_min_free";
constexpr MetricKey kMetricHeapExternalLargestBlock = "external_largest_block";

// Task runtime
Expand Down Expand Up @@ -482,8 +482,7 @@ void LogHeapDataCallback(chip::System::Layer * systemLayer, void * appState)
void FailedAllocCallback(size_t size, uint32_t caps, const char * function_name)
{
MATTER_TRACE_COUNTER("Failed_memory_allocations");
ESP_LOGE(TAG, "Memory allocation failed!");
ESP_LOGE(TAG, "Requested Size: %zu, Caps: %lu, Function: %s", size, caps, function_name);
ChipLogError(DeviceLayer, "Memory allocation failed!");
}

// Function to initialize and start periodic heap logging
Expand All @@ -492,15 +491,14 @@ void ESP32Utils::LogHeapInfo()
esp_err_t err = heap_caps_register_failed_alloc_callback(FailedAllocCallback);
if (err != ESP_OK)
{
ESP_LOGE(TAG, "Failed to register callback. Error: 0x%08x", err);
ChipLogError(DeviceLayer, "Failed to register callback. Error: 0x%08x", err);
}
LogHeapDataCallback(&SystemLayer(), nullptr);

// Start the periodic logging using SystemLayer
SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(CONFIG_HEAP_LOG_INTERVAL), LogHeapDataCallback, nullptr);
}


const char * StateToString(eTaskState state)
{
switch (state)
Expand Down

0 comments on commit 4ac601c

Please sign in to comment.