diff --git a/CHANGELOG.md b/CHANGELOG.md index 7788b0d..5da854a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,19 @@ # Changelog * Unreleased +* 1.2.2 (2020-12-20) + * Add generic definition of `FPSTR()` macro for unrecognized platforms. + Allows code with `ARDUINO_ARCH_STM32` dependencies to compile. I will + support it officially after I get hardware to perform actual validation. + * Clean up MemoryBenchmark scripts for consistency with other `Ace*` + libraries. + * No functional change in this release. * 1.2.1 (2020-11-12) * Add `DEVELOPER.md` notes to myself. * Add python script to generate the README.md in [examples/MemoryBenchmarks](examples/MemoryBenchmarks) to automatically regenerate the embedded ascii tables. Regenerate README.md for v1.2. + * No functional change in this release. * 1.2 (2020-11-10) * Fix an infinite loop in the internal singly-linked list of coroutines when `resume()` is called immediately after `suspend()`, without waiting for diff --git a/README.md b/README.md index cfed487..de2b869 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # AceRoutine +![AUnit Tests](https://github.com/bxparks/AceRoutine/workflows/AUnit%20Tests/badge.svg) + A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms. @@ -79,26 +81,25 @@ AceRoutine is a self-contained library that works on any platform supporting the Arduino API (AVR, Teensy, ESP8266, ESP32, etc), and it provides a handful of additional macros that can reduce boilerplate code. - -**Version**: 1.2.1 (2020-11-12) +**Version**: 1.2.2 (2020-12-20) **Changelog**: [CHANGELOG.md](CHANGELOG.md) **Important Change in v1.1**: This library now depends on the AceCommon library (https://github.com/bxparks/AceCommon). See the *Installation* section below. -![AUnit Tests](https://github.com/bxparks/AceRoutine/workflows/AUnit%20Tests/badge.svg) - -**Table of Contents** +## Table of Contents * [Hello Coroutines](#HelloCoroutines) * [Installation](#Installation) * [Source Code](#SourceCode) - * [Docs](#Docs) +* [Documentation](#Documentation) * [Examples](#Examples) -* [User Guide](#UserGuide) * [Comparisons](#Comparisons) * [Resource Consumption](#ResourceConsumption) + * [Static Memory](#StaticMemory) + * [Flash Memory](#FlashMemory) + * [CPU](#CPU) * [System Requirements](#SystemRequirements) * [License](#LicenseSystemRequirements) * [Feedback](#Feedback) @@ -281,11 +282,13 @@ The source files are organized as follows: [AUnit](https://github.com/bxparks/AUnit) * `examples/` - example programs - -### Docs + +## Documentation -The [docs/](docs/) directory contains the -[Doxygen docs published on GitHub Pages](https://bxparks.github.io/AceRoutine/html). +* [README.md](README.md) - this file +* [Doxygen docs](https://bxparks.github.io/AceRoutine/html) published on GitHub + Pages +* [USER_GUIDE.md](USER_GUIDE.md) ### Examples @@ -331,11 +334,6 @@ The following programs are provided under the `examples` directory: of CPU overhead of a `Channel` by using 2 coroutines to ping-pong an integer across 2 channels - -## User Guide - -**The user guide has been moved to [USER_GUIDE.md](USER_GUIDE.md).** - ## Comparisons to Other Multitasking Libraries @@ -421,6 +419,7 @@ advantages: ## Resource Consumption + ### Static Memory All objects are statically allocated (i.e. not heap or stack). @@ -446,6 +445,7 @@ The `Channel` object requires 2 copies of the parameterized `` type so its size is equal to `1 + 2 * sizeof(T)`, rounded to the nearest memory alignment boundary (i.e. a total of 12 bytes for a 32-bit processor). + ### Flash Memory The [examples/MemoryBenchmark](examples/MemoryBenchmark) program gathers @@ -463,6 +463,7 @@ etc) for a handful of AceRoutine features. Here are some highlights: * `CoroutineScheduler()` + 1 Coroutine: 808 bytes * `CoroutineScheduler()` + 2 Coroutines: 908 bytes + ### CPU See [examples/AutoBenchmark](examples/AutoBenchmark). diff --git a/USER_GUIDE.md b/USER_GUIDE.md index b64f67b..d758d5f 100644 --- a/USER_GUIDE.md +++ b/USER_GUIDE.md @@ -4,9 +4,9 @@ See the [README.md](README.md) for installation instructions and other background information. This document describes how to use the library once it is installed. -**Version**: 1.2.1 (2020-11-12) +**Version**: 1.2.2 (2020-12-20) -**Table of Contents** +## Table of Contents * [Coroutine Setup](#Setup) * [Include Header and Namespace](#IncludeHeader) diff --git a/docs/doxygen.cfg b/docs/doxygen.cfg index caa0944..2834b49 100644 --- a/docs/doxygen.cfg +++ b/docs/doxygen.cfg @@ -38,7 +38,7 @@ PROJECT_NAME = "AceRoutine" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.2.1 +PROJECT_NUMBER = 1.2.2 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/docs/html/AceRoutine_8h_source.html b/docs/html/AceRoutine_8h_source.html index 4325650..2bc25d3 100644 --- a/docs/html/AceRoutine_8h_source.html +++ b/docs/html/AceRoutine_8h_source.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
@@ -103,8 +103,8 @@
41 #include "ace_routine/Channel.h"
42 
43 // Version format: xxyyzz == "xx.yy.zz"
-
44 #define ACE_ROUTINE_VERSION 10201
-
45 #define ACE_ROUTINE_VERSION_STRING "1.2.1"
+
44 #define ACE_ROUTINE_VERSION 10202
+
45 #define ACE_ROUTINE_VERSION_STRING "1.2.2"
46 
47 #endif
diff --git a/docs/html/Channel_8h_source.html b/docs/html/Channel_8h_source.html index 1a3ba2b..d289f1c 100644 --- a/docs/html/Channel_8h_source.html +++ b/docs/html/Channel_8h_source.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
diff --git a/docs/html/CoroutineScheduler_8cpp_source.html b/docs/html/CoroutineScheduler_8cpp_source.html index ddfa106..d6d18da 100644 --- a/docs/html/CoroutineScheduler_8cpp_source.html +++ b/docs/html/CoroutineScheduler_8cpp_source.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
diff --git a/docs/html/CoroutineScheduler_8h_source.html b/docs/html/CoroutineScheduler_8h_source.html index d5136d4..f7f42c8 100644 --- a/docs/html/CoroutineScheduler_8h_source.html +++ b/docs/html/CoroutineScheduler_8h_source.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
diff --git a/docs/html/Coroutine_8cpp_source.html b/docs/html/Coroutine_8cpp_source.html index b1faa08..679d0be 100644 --- a/docs/html/Coroutine_8cpp_source.html +++ b/docs/html/Coroutine_8cpp_source.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
@@ -216,12 +216,12 @@
143 static const char kStatusTerminatedString[] PROGMEM = "Terminated";
144 
145 const __FlashStringHelper* const Coroutine::sStatusStrings[] = {
-
146  FPSTR(kStatusSuspendedString),
-
147  FPSTR(kStatusYieldingString),
-
148  FPSTR(kStatusDelayingString),
-
149  FPSTR(kStatusRunningString),
-
150  FPSTR(kStatusEndingString),
-
151  FPSTR(kStatusTerminatedString),
+
146  FPSTR(kStatusSuspendedString),
+
147  FPSTR(kStatusYieldingString),
+
148  FPSTR(kStatusDelayingString),
+
149  FPSTR(kStatusRunningString),
+
150  FPSTR(kStatusEndingString),
+
151  FPSTR(kStatusTerminatedString),
152 };
153 
154 }
@@ -229,6 +229,7 @@
static const uint8_t kDelayTypeSeconds
Delay using units of seconds.
Definition: Coroutine.h:503
void resume()
Add a Suspended coroutine into the head of the scheduler linked list, and change the state to Yieldin...
Definition: Coroutine.cpp:103
static const uint8_t kDelayTypeMillis
Delay using units of millis.
Definition: Coroutine.h:497
+
#define FPSTR(p)
A macro that converts a const char* that already points to a PROGMEM string to a const __FlashStringH...
Definition: compat.h:81
virtual unsigned long coroutineMicros() const
Returns the current millisecond clock.
Definition: Coroutine.cpp:118
static const Status kStatusSuspended
Coroutine has been suspended using suspend() and the scheduler should remove it from the queue upon t...
Definition: Coroutine.h:479
diff --git a/docs/html/Coroutine_8h.html b/docs/html/Coroutine_8h.html index c2e2175..f91e944 100644 --- a/docs/html/Coroutine_8h.html +++ b/docs/html/Coroutine_8h.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
diff --git a/docs/html/Coroutine_8h_source.html b/docs/html/Coroutine_8h_source.html index 818b87b..3818b75 100644 --- a/docs/html/Coroutine_8h_source.html +++ b/docs/html/Coroutine_8h_source.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
diff --git a/docs/html/annotated.html b/docs/html/annotated.html index 18bc73a..1173fc1 100644 --- a/docs/html/annotated.html +++ b/docs/html/annotated.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
diff --git a/docs/html/classace__routine_1_1Channel-members.html b/docs/html/classace__routine_1_1Channel-members.html index eac6142..bb02aa8 100644 --- a/docs/html/classace__routine_1_1Channel-members.html +++ b/docs/html/classace__routine_1_1Channel-members.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
diff --git a/docs/html/classace__routine_1_1Channel.html b/docs/html/classace__routine_1_1Channel.html index 52357f2..db1861b 100644 --- a/docs/html/classace__routine_1_1Channel.html +++ b/docs/html/classace__routine_1_1Channel.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
diff --git a/docs/html/classace__routine_1_1Coroutine-members.html b/docs/html/classace__routine_1_1Coroutine-members.html index 7fef941..5763c28 100644 --- a/docs/html/classace__routine_1_1Coroutine-members.html +++ b/docs/html/classace__routine_1_1Coroutine-members.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
diff --git a/docs/html/classace__routine_1_1Coroutine.html b/docs/html/classace__routine_1_1Coroutine.html index 3e87149..2ee82af 100644 --- a/docs/html/classace__routine_1_1Coroutine.html +++ b/docs/html/classace__routine_1_1Coroutine.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
diff --git a/docs/html/classace__routine_1_1CoroutineScheduler-members.html b/docs/html/classace__routine_1_1CoroutineScheduler-members.html index be9e71c..391cee0 100644 --- a/docs/html/classace__routine_1_1CoroutineScheduler-members.html +++ b/docs/html/classace__routine_1_1CoroutineScheduler-members.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
diff --git a/docs/html/classace__routine_1_1CoroutineScheduler.html b/docs/html/classace__routine_1_1CoroutineScheduler.html index 52bc7b5..e3b7020 100644 --- a/docs/html/classace__routine_1_1CoroutineScheduler.html +++ b/docs/html/classace__routine_1_1CoroutineScheduler.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
diff --git a/docs/html/classes.html b/docs/html/classes.html index 5a438d7..224aaf7 100644 --- a/docs/html/classes.html +++ b/docs/html/classes.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
diff --git a/docs/html/compat_8h.html b/docs/html/compat_8h.html index cb9ea42..d99a939 100644 --- a/docs/html/compat_8h.html +++ b/docs/html/compat_8h.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
@@ -67,6 +67,8 @@
+
compat.h File Reference
@@ -92,11 +94,19 @@

Go to the source code of this file.

+ + + + + +

+Macros

+#define FPSTR(p)   (reinterpret_cast<const __FlashStringHelper *>(p))
 A macro that converts a const char* that already points to a PROGMEM string to a const __FlashStringHelper* which can be passed to overloaded functions and methods.
 

Detailed Description

Various macros to smooth over the differences among the various platforms with regards to their support for flash strings and the various macros used to create and access them.

Copied from AUnit/src/aunit/Flash.h and AceTime/src/ace_time/common/compat.h.

We support flash strings (F() macro) for AVR because those MCUs have very small static RAM (1-2kB). Prior to v1.0, we disabled F() for ESP8266 because those implementations were buggy. But it seems that recent ESP8266 cores (v2.5 and higher) seems to have fixed the problems with F(), so I have reactivated it. The F() is automatically a no-op for Teensy and ESP32.

-

The FPSTR() macro is a useful macro that was originally created on the ESP8266. But it was incorrectly implemented on the ESP32, until https://github.com/espressif/arduino-esp32/issues/1371 is fixed (hopefully by v1.0.3).

+

The FPSTR() macro is a useful macro that was originally created on the ESP8266. But it was incorrectly implemented on the ESP32, until https://github.com/espressif/arduino-esp32/issues/1371 is fixed (hopefully by v1.0.3).

Definition in file compat.h.

diff --git a/docs/html/compat_8h_source.html b/docs/html/compat_8h_source.html index 0fe80e8..2da6732 100644 --- a/docs/html/compat_8h_source.html +++ b/docs/html/compat_8h_source.html @@ -22,7 +22,7 @@
AceRoutine -  1.2.1 +  1.2.2
A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
@@ -123,11 +123,15 @@
72 
73 #else
74  #warning Untested platform, AceRoutine may still work...
-
75  #include <avr/pgmspace.h>
+
75  #ifndef FPSTR
76 
-
77 #endif
-
78 
-
79 #endif
+
81  #define FPSTR(p) (reinterpret_cast<const __FlashStringHelper *>(p))
+
82  #endif
+
83  #include <avr/pgmspace.h>
+
84 
+
85 #endif
+
86 
+
87 #endif