Skip to content

Commit 776cb42

Browse files
committed
Merge branch 'testing'
2 parents fadff97 + 635cfd5 commit 776cb42

17 files changed

+891
-222
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Task Scheduler
22
### Cooperative multitasking for Arduino, ESPx, STM32 and other microcontrollers
3-
#### Version 3.4.0: 2021-07-14 [Latest updates](https://github.com/arkhipenko/TaskScheduler/wiki/Latest-Updates)
3+
#### Version 3.6.0: 2021-12-17 [Latest updates](https://github.com/arkhipenko/TaskScheduler/wiki/Latest-Updates)
44

55
[![arduino-library-badge](https://www.ardu-badge.com/badge/TaskScheduler.svg?)](https://www.ardu-badge.com/TaskScheduler)[![xscode](https://img.shields.io/badge/Available%20on-xs%3Acode-blue?style=?style=plastic&logo=appveyor&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF////////VXz1bAAAAAJ0Uk5T/wDltzBKAAAAlUlEQVR42uzXSwqAMAwE0Mn9L+3Ggtgkk35QwcnSJo9S+yGwM9DCooCbgn4YrJ4CIPUcQF7/XSBbx2TEz4sAZ2q1RAECBAiYBlCtvwN+KiYAlG7UDGj59MViT9hOwEqAhYCtAsUZvL6I6W8c2wcbd+LIWSCHSTeSAAECngN4xxIDSK9f4B9t377Wd7H5Nt7/Xz8eAgwAvesLRjYYPuUAAAAASUVORK5CYII=)](https://xscode.com/arkhipenko/TaskScheduler)
66

@@ -34,6 +34,7 @@ _“Everybody who learns concurrency and thinks they understand it, ends up find
3434
13. CPU load / idle statistics for time critical applications
3535
14. Scheduling options with priority for original schedule (with and without catchup) and interval
3636
15. Ability to pause/resume and enable/disable scheduling
37+
15. Thread-safe scheduling while running under preemptive scheduler (i. e., FreeRTOS)
3738

3839
Scheduling overhead: between `15` and `18` microseconds per scheduling pass (Arduino UNO rev 3 @ `16MHz` clock, single scheduler w/o prioritization)
3940

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.pio
2+
.vscode/.browse.c_cpp.db*
3+
.vscode/c_cpp_properties.json
4+
.vscode/launch.json
5+
.vscode/ipch
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"platformio.platformio-ide"
6+
]
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
This directory is intended for project header files.
3+
4+
A header file is a file containing C declarations and macro definitions
5+
to be shared between several project source files. You request the use of a
6+
header file in your project source file (C, C++, etc) located in `src` folder
7+
by including it, with the C preprocessing directive `#include'.
8+
9+
```src/main.c
10+
11+
#include "header.h"
12+
13+
int main (void)
14+
{
15+
...
16+
}
17+
```
18+
19+
Including a header file produces the same results as copying the header file
20+
into each source file that needs it. Such copying would be time-consuming
21+
and error-prone. With a header file, the related declarations appear
22+
in only one place. If they need to be changed, they can be changed in one
23+
place, and programs that include the header file will automatically use the
24+
new version when next recompiled. The header file eliminates the labor of
25+
finding and changing all the copies as well as the risk that a failure to
26+
find one copy will result in inconsistencies within a program.
27+
28+
In C, the usual convention is to give header files names that end with `.h'.
29+
It is most portable to use only letters, digits, dashes, and underscores in
30+
header file names, and at most one dot.
31+
32+
Read more about using header files in official GCC documentation:
33+
34+
* Include Syntax
35+
* Include Operation
36+
* Once-Only Headers
37+
* Computed Includes
38+
39+
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#ifndef _TS27_LED_H
2+
#define _TS27_LED_H
3+
4+
// LED_BUILTIN 13
5+
#if defined( ARDUINO_ARCH_ESP32 )
6+
#define LED_BUILTIN 23 // esp32 dev2 kit does not have LED
7+
#endif
8+
9+
void LEDOff();
10+
void LEDOn();
11+
12+
#endif // _TS27_LED_H
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#ifndef _TS27_MAIN_H
2+
#define _TS27_MAIN_H
3+
4+
#include <Arduino.h>
5+
6+
#ifdef _DEBUG_
7+
#define _PP(a) Serial.print(a);
8+
#define _PL(a) Serial.println(a);
9+
#else
10+
#define _PP(a)
11+
#define _PL(a)
12+
#endif
13+
14+
#define PERIOD1 500
15+
#define DURATION 10000
16+
17+
#define PERIOD2 400
18+
19+
#define PERIOD3 300
20+
21+
#define PERIOD4 200
22+
23+
#define PERIOD5 600
24+
25+
#define PERIOD6 300
26+
27+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
This directory is intended for project specific (private) libraries.
3+
PlatformIO will compile them to static libraries and link into executable file.
4+
5+
The source code of each library should be placed in a an own separate directory
6+
("lib/your_library_name/[here are source files]").
7+
8+
For example, see a structure of the following two libraries `Foo` and `Bar`:
9+
10+
|--lib
11+
| |
12+
| |--Bar
13+
| | |--docs
14+
| | |--examples
15+
| | |--src
16+
| | |- Bar.c
17+
| | |- Bar.h
18+
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
19+
| |
20+
| |--Foo
21+
| | |- Foo.c
22+
| | |- Foo.h
23+
| |
24+
| |- README --> THIS FILE
25+
|
26+
|- platformio.ini
27+
|--src
28+
|- main.c
29+
30+
and a contents of `src/main.c`:
31+
```
32+
#include <Foo.h>
33+
#include <Bar.h>
34+
35+
int main (void)
36+
{
37+
...
38+
}
39+
40+
```
41+
42+
PlatformIO Library Dependency Finder will find automatically dependent
43+
libraries scanning project source files.
44+
45+
More information about PlatformIO Library Dependency Finder
46+
- https://docs.platformio.org/page/librarymanager/ldf.html
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
; PlatformIO Project Configuration File
2+
;
3+
; Build options: build flags, source filter
4+
; Upload options: custom upload port, speed and extra flags
5+
; Library options: dependencies, extra library storages
6+
; Advanced options: extra scripting
7+
;
8+
; Please visit documentation for the other options and examples
9+
; https://docs.platformio.org/page/projectconf.html
10+
11+
[env:esp32dev]
12+
platform = espressif32
13+
board = esp32dev
14+
framework = arduino
15+
16+
[env]
17+
lib_deps =
18+
arkhipenko/TaskScheduler @ ^3.4.0
19+
20+
build_flags =
21+
; -D _TASK_TIMECRITICAL
22+
-D _TASK_SLEEP_ON_IDLE_RUN
23+
-D _TASK_STATUS_REQUEST
24+
; -D _TASK_WDT_IDS
25+
; -D _TASK_LTS_POINTER
26+
; -D _TASK_PRIORITY
27+
; -D _TASK_MICRO_RES
28+
; -D _TASK_STD_FUNCTION
29+
; -D _TASK_DEBUG
30+
; -D _TASK_INLINE
31+
; -D _TASK_TIMEOUT
32+
; -D _TASK_OO_CALLBACKS
33+
; -D _TASK_EXPOSE_CHAIN
34+
; -D _TASK_SCHEDULING_OPTIONS
35+
; -D _TASK_DEFINE_MILLIS
36+
; -D _TASK_EXTERNAL_TIME
37+
-D _DEBUG_
38+
; -D _TEST_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include <TaskScheduler.h>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <Arduino.h>
2+
#include "led.h"
3+
#include "main.h"
4+
5+
void LEDOn() {
6+
digitalWrite( LED_BUILTIN, HIGH );
7+
}
8+
9+
void LEDOff() {
10+
digitalWrite( LED_BUILTIN, LOW );
11+
}

0 commit comments

Comments
 (0)