Initialize TaskScheduler
This commit is contained in:
parent
94170545ed
commit
a7c9c2df1a
6
include/Scheduler.h
Normal file
6
include/Scheduler.h
Normal file
@ -0,0 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#pragma once
|
||||
|
||||
#include <TaskSchedulerDeclarations.h>
|
||||
|
||||
extern Scheduler scheduler;
|
||||
@ -23,6 +23,7 @@ platform = espressif32@6.3.2
|
||||
|
||||
build_flags =
|
||||
-DPIOENV=\"$PIOENV\"
|
||||
-D_TASK_STD_FUNCTION=1
|
||||
-Wall -Wextra -Werror
|
||||
-std=c++17
|
||||
-std=gnu++17
|
||||
@ -36,6 +37,7 @@ lib_deps =
|
||||
nrf24/RF24 @ ^1.4.8
|
||||
olikraus/U8g2 @ ^2.35.7
|
||||
buelowp/sunset @ ^1.1.7
|
||||
https://github.com/arkhipenko/TaskScheduler#testing
|
||||
|
||||
extra_scripts =
|
||||
pre:pio-scripts/auto_firmware_version.py
|
||||
|
||||
7
src/Scheduler.cpp
Normal file
7
src/Scheduler.cpp
Normal 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;
|
||||
@ -16,12 +16,14 @@
|
||||
#include "NetworkSettings.h"
|
||||
#include "NtpSettings.h"
|
||||
#include "PinMapping.h"
|
||||
#include "Scheduler.h"
|
||||
#include "SunPosition.h"
|
||||
#include "Utils.h"
|
||||
#include "WebApi.h"
|
||||
#include "defaults.h"
|
||||
#include <Arduino.h>
|
||||
#include <LittleFS.h>
|
||||
#include <TaskScheduler.h>
|
||||
|
||||
void setup()
|
||||
{
|
||||
@ -149,6 +151,8 @@ void setup()
|
||||
|
||||
void loop()
|
||||
{
|
||||
scheduler.execute();
|
||||
|
||||
NetworkSettings.loop();
|
||||
yield();
|
||||
InverterSettings.loop();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user