From 4c479d1710db77d8f2dafb7ff40b4c7566dea3ee Mon Sep 17 00:00:00 2001 From: technyon Date: Tue, 22 Mar 2022 21:34:24 +0100 Subject: [PATCH] add FreeRTOS and create network task --- main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 2ce6cc3..0194195 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,7 @@ #include "Arduino.h" #include "Network.h" #include "Nuki.h" +#include #define ESP32 @@ -8,6 +9,15 @@ Network network; Nuki nuki("door", 0); +void networkTask(void *pvParameters) +{ + network.update(); +} + +void setupTasks() +{ + xTaskCreate(networkTask, "ntw", 1024, NULL, 1, NULL); +} void setup() { @@ -27,10 +37,10 @@ void setup() Serial.println("Connected to the WiFi network"); */ + setupTasks(); } void loop() { - network.update(); // nuki.update(); } \ No newline at end of file