Check for memory leaks

This commit is contained in:
2024-08-18 21:01:34 +02:00
parent 38197afd79
commit 05e347e80c
4 changed files with 34 additions and 1 deletions

View File

@ -1,15 +1,25 @@
#include "system.h"
#include "esp_log.h"
#include "esp_system.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
static const char *TAG = "system";
void system_sleep(size_t secs)
{
vTaskDelay((1000 * secs) / portTICK_PERIOD_MS);
}
size_t system_show_free_memory()
{
size_t v = heap_caps_get_free_size(MALLOC_CAP_DEFAULT);
ESP_LOGI(TAG, "heap_caps_free_size(MALLOC_CAP_DEFAULT) = %d", v);
return v;
}
void reboot()
{
fflush(stdout);