Implement Wi-Fi task
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
#ifndef WIFI_HPP
|
||||
#define WIFI_HPP
|
||||
|
||||
void wifiTask(void *pvParameters);
|
||||
|
||||
#endif
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
Reference in New Issue
Block a user