Initialize TaskScheduler

This commit is contained in:
Thomas Basler 2023-11-20 20:50:01 +01:00
parent 94170545ed
commit a7c9c2df1a
4 changed files with 19 additions and 0 deletions

6
include/Scheduler.h Normal file
View File

@ -0,0 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <TaskSchedulerDeclarations.h>
extern Scheduler scheduler;

View File

@ -23,6 +23,7 @@ platform = espressif32@6.3.2
build_flags = build_flags =
-DPIOENV=\"$PIOENV\" -DPIOENV=\"$PIOENV\"
-D_TASK_STD_FUNCTION=1
-Wall -Wextra -Werror -Wall -Wextra -Werror
-std=c++17 -std=c++17
-std=gnu++17 -std=gnu++17
@ -36,6 +37,7 @@ lib_deps =
nrf24/RF24 @ ^1.4.8 nrf24/RF24 @ ^1.4.8
olikraus/U8g2 @ ^2.35.7 olikraus/U8g2 @ ^2.35.7
buelowp/sunset @ ^1.1.7 buelowp/sunset @ ^1.1.7
https://github.com/arkhipenko/TaskScheduler#testing
extra_scripts = extra_scripts =
pre:pio-scripts/auto_firmware_version.py pre:pio-scripts/auto_firmware_version.py

7
src/Scheduler.cpp Normal file
View File

@ -0,0 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) 2023 Thomas Basler and others
*/
#include "Scheduler.h"
Scheduler scheduler;

View File

@ -16,12 +16,14 @@
#include "NetworkSettings.h" #include "NetworkSettings.h"
#include "NtpSettings.h" #include "NtpSettings.h"
#include "PinMapping.h" #include "PinMapping.h"
#include "Scheduler.h"
#include "SunPosition.h" #include "SunPosition.h"
#include "Utils.h" #include "Utils.h"
#include "WebApi.h" #include "WebApi.h"
#include "defaults.h" #include "defaults.h"
#include <Arduino.h> #include <Arduino.h>
#include <LittleFS.h> #include <LittleFS.h>
#include <TaskScheduler.h>
void setup() void setup()
{ {
@ -149,6 +151,8 @@ void setup()
void loop() void loop()
{ {
scheduler.execute();
NetworkSettings.loop(); NetworkSettings.loop();
yield(); yield();
InverterSettings.loop(); InverterSettings.loop();