HB, OTA etc

This commit is contained in:
2026-04-22 20:11:55 +03:00
parent 4100931deb
commit cb1014c950
76 changed files with 3157 additions and 232 deletions

View File

@@ -0,0 +1,31 @@
#include "heartbeat_task.h"
extern "C" {
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#include "protocol.h"
#include <time.h>
}
static const char *TAG = "heartbeat";
static void heartbeat_task(void *arg)
{
while (1) {
if (protocol_is_connected()) {
time_t now;
time(&now);
protocol_send_event_hb((uint32_t)now);
}
vTaskDelay(pdMS_TO_TICKS(10000)); // 10 сек
}
}
void heartbeat_task_start()
{
xTaskCreate(heartbeat_task, "heartbeat", 4096, NULL, 5, NULL);
}