27 lines
488 B
C
Raw Normal View History

2024-07-27 16:15:35 +02:00
#include "system.h"
2024-08-18 21:01:34 +02:00
#include "esp_log.h"
2024-07-27 16:15:35 +02:00
#include "esp_system.h"
2024-08-17 17:19:47 +02:00
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
2024-08-18 21:01:34 +02:00
static const char *TAG = "system";
2024-08-17 17:19:47 +02:00
void system_sleep(size_t secs)
{
vTaskDelay((1000 * secs) / portTICK_PERIOD_MS);
}
2024-08-18 21:01:34 +02:00
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;
}
2024-07-27 16:15:35 +02:00
void reboot()
{
fflush(stdout);
esp_restart();
}