Implement Wi-Fi task

This commit is contained in:
2025-10-11 15:29:14 +02:00
parent eb980d286d
commit 94d2a61cad
3 changed files with 28 additions and 1 deletions
+6
View File
@@ -0,0 +1,6 @@
#ifndef WIFI_HPP
#define WIFI_HPP
void wifiTask(void *pvParameters);
#endif
+3 -1
View File
@@ -1,6 +1,7 @@
#include <iostream>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "esp_system.h"
#include "esp_log.h"
#include "esp_pm.h"
@@ -46,5 +47,6 @@ extern "C" void app_main(void)
heap_caps_init();
xTaskCreate(watchdogTask, "wdt", 2048, NULL, configMAX_PRIORITIES-1, NULL);
xTaskCreate(watchdogTask, "watchdogs", 2048, NULL, configMAX_PRIORITIES-1, NULL);
xTaskCreate(wifiTask, "wifi", 4096, NULL, configMAX_PRIORITIES-4, NULL);
}
+19
View File
@@ -0,0 +1,19 @@
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "esp_system.h"
#include "esp_log.h"
#include "esp_pm.h"
#include "esp_task_wdt.h"
#include "esp_wifi.h"
void wifiTask(void *pvParameters) {
ESP_ERROR_CHECK(esp_task_wdt_add(NULL));
// wifi here
wifiConnection();
esp_task_wdt_reset();
vTaskDelay(pdMS_TO_TICKS(2500));
}