Skip to content

Commit

Permalink
debugging memory
Browse files Browse the repository at this point in the history
  • Loading branch information
stintel committed Aug 2, 2023
1 parent ad51af8 commit 7b511a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main/endpoint/hass.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ static void hass_post(const char *data)
free(body);

free(url);

ESP_LOGI(TAG, "min_free_iram: %d", heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL));
ESP_LOGI(TAG, "min_free_spiram: %d", heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM));
}

static void hass_send_ws(const char *data)
Expand Down Expand Up @@ -430,6 +433,8 @@ static void hass_send_ws(const char *data)
ESP_LOGE(TAG, "failed to send command via WebSocket client");
}
cJSON_Delete(cjson);
ESP_LOGI(TAG, "min_free_iram: %d", heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL));
ESP_LOGI(TAG, "min_free_spiram: %d", heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM));
}

void hass_send(const char *data)
Expand Down
2 changes: 2 additions & 0 deletions main/endpoint/rest.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ void rest_send(const char *data)
lvgl_port_unlock();
}

ESP_LOGI(TAG, "min_free_iram: %d", heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL));
ESP_LOGI(TAG, "min_free_spiram: %d", heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM));
reset_timer(hdl_display_timer, DISPLAY_TIMEOUT_US, false);

free(body);
Expand Down
4 changes: 4 additions & 0 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ void app_main(void)
#ifdef CONFIG_WILLOW_DEBUG_TIMERS
(esp_timer_dump(stdout));
#endif
ESP_LOGI(TAG, "min_free_iram: %d", heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL));
ESP_LOGI(TAG, "min_free_spiram: %d", heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM));
vTaskDelay(5000 / portTICK_PERIOD_MS);
ESP_LOGI(TAG, "checking heap integrity");
heap_caps_check_integrity_all(true);
}
}

0 comments on commit 7b511a1

Please sign in to comment.