Skip to content

Commit e50f0b4

Browse files
authored
Merge pull request #54 from bxparks/develop
merge 1.5.1 into master
2 parents 8a0666a + dddfd58 commit e50f0b4

File tree

172 files changed

+2044
-1551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+2044
-1551
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# Changelog
22

33
* Unreleased
4+
* 1.5.1 (2022-09-20)
5+
* Add Adafruit nRF52 boards to "Tier 2" after validation by community
6+
member.
7+
* Upgrade tool chain
8+
* Arduino CLI from 0.19.2 to 0.27.1
9+
* Arduino AVR Core from 1.8.4 to 1.8.5
10+
* STM32duino from 2.2.0 to 2.3.0
11+
* ESP32 Core from 2.0.2 to 2.0.5
12+
* Teensyduino from 1.56 to 1.57
413
* 1.5.0 (2022-03-19)
514
* (Re)add support for human-readable coroutine names.
615
* See [Coroutine Names](USER_GUIDE.md#CoroutineNames) in the

README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ AceRoutine is a self-contained library that works on any platform supporting the
120120
Arduino API (AVR, Teensy, ESP8266, ESP32, etc), and it provides a handful of
121121
additional macros that can reduce boilerplate code.
122122

123-
**Version**: 1.5.0 (2022-03-19)
123+
**Version**: 1.5.1 (2022-09-20)
124124

125125
**Changelog**: [CHANGELOG.md](CHANGELOG.md)
126126

@@ -510,7 +510,7 @@ The development version can be installed by cloning the following git repos:
510510
511511
You can copy these directories to the `./libraries` directory used by the
512512
Arduino IDE. (You should see 2 directories, named `./libraries/AceRoutine` and
513-
`./libraries/AceCommon). Or you can create symlinks from `/.libraries` to these
513+
`./libraries/AceCommon`). Or you can create symlinks from `/.libraries` to these
514514
directories.
515515
516516
The `develop` branch contains the latest working version.
@@ -834,13 +834,13 @@ Arduino Nano:
834834
+---------------------------------+--------+-------------+--------+
835835
| Functionality | iters | micros/iter | diff |
836836
|---------------------------------+--------+-------------+--------|
837-
| EmptyLoop | 10000 | 1.900 | 0.000 |
837+
| EmptyLoop | 10000 | 1.700 | 0.000 |
838838
|---------------------------------+--------+-------------+--------|
839-
| DirectScheduling | 10000 | 2.800 | 0.900 |
840-
| DirectSchedulingWithProfiler | 10000 | 5.800 | 3.900 |
839+
| DirectScheduling | 10000 | 2.900 | 1.200 |
840+
| DirectSchedulingWithProfiler | 10000 | 5.700 | 4.000 |
841841
|---------------------------------+--------+-------------+--------|
842-
| CoroutineScheduling | 10000 | 7.000 | 5.100 |
843-
| CoroutineSchedulingWithProfiler | 10000 | 9.300 | 7.400 |
842+
| CoroutineScheduling | 10000 | 7.100 | 5.400 |
843+
| CoroutineSchedulingWithProfiler | 10000 | 9.300 | 7.600 |
844844
+---------------------------------+--------+-------------+--------+
845845
```
846846
@@ -850,13 +850,13 @@ ESP8266:
850850
+---------------------------------+--------+-------------+--------+
851851
| Functionality | iters | micros/iter | diff |
852852
|---------------------------------+--------+-------------+--------|
853-
| EmptyLoop | 10000 | 0.100 | 0.000 |
853+
| EmptyLoop | 10000 | 0.200 | 0.000 |
854854
|---------------------------------+--------+-------------+--------|
855-
| DirectScheduling | 10000 | 0.500 | 0.400 |
856-
| DirectSchedulingWithProfiler | 10000 | 0.800 | 0.700 |
855+
| DirectScheduling | 10000 | 0.500 | 0.300 |
856+
| DirectSchedulingWithProfiler | 10000 | 0.800 | 0.600 |
857857
|---------------------------------+--------+-------------+--------|
858-
| CoroutineScheduling | 10000 | 0.900 | 0.800 |
859-
| CoroutineSchedulingWithProfiler | 10000 | 1.100 | 1.000 |
858+
| CoroutineScheduling | 10000 | 0.900 | 0.700 |
859+
| CoroutineSchedulingWithProfiler | 10000 | 1.100 | 0.900 |
860860
+---------------------------------+--------+-------------+--------+
861861
```
862862
@@ -880,12 +880,16 @@ These boards are tested on each release:
880880
881881
**Tier 2: Should work**
882882
883-
These boards should work but I don't test them as often:
883+
These boards should work, but they are not tested frequently by me, or I don't
884+
own the specific hardware so they were tested by a community member:
884885
885886
* ATtiny85 (8 MHz ATtiny85)
886887
* Arduino Pro Mini (16 MHz ATmega328P)
887888
* Mini Mega 2560 (Arduino Mega 2560 compatible, 16 MHz ATmega2560)
888889
* Teensy LC (48 MHz ARM Cortex-M0+)
890+
* [Adafruit nRF52 Boards](https://github.com/adafruit/Adafruit_nRF52_Arduino)
891+
* [Circuit Playground Bluefruit](https://www.adafruit.com/product/4333)
892+
tested by a community member
889893
890894
**Tier 3: May work, but not supported**
891895
@@ -924,6 +928,7 @@ This library was developed and tested using:
924928
* [ESP8266 Arduino 3.0.2](https://github.com/esp8266/Arduino)
925929
* [ESP32 Arduino 2.0.2](https://github.com/espressif/arduino-esp32)
926930
* [Teensyduino 1.56](https://www.pjrc.com/teensy/td_download.html)
931+
* [Adafruit nRF52 1.3.0](https://github.com/adafruit/Adafruit_nRF52_Arduino)
927932
928933
This library is *not* compatible with:
929934

USER_GUIDE.md

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ See the [README.md](README.md) for installation instructions and other
44
background information. This document describes how to use the library once it
55
is installed.
66

7-
**Version**: 1.5.0 (2022-03-19)
7+
**Version**: 1.5.1 (2022-09-20)
88

99
## Table of Contents
1010

@@ -1153,22 +1153,25 @@ about 14 bytes of flash per invocation.
11531153

11541154
Version 1.5 added the ability to profile the execution time of
11551155
`Coroutine::runCoroutine()` and render the information as a formatted table, or
1156-
as a JSON object. If the profiling feature is not used, no additional flash
1157-
memory is consumed. The static RAM usage does increase by 2 bytes (8-bits) and 4
1158-
bytes (32-bits) per coroutine.
1156+
as a JSON object. (Thanks to peufeu2@ who proposed the idea and provided the
1157+
initial proof of concept in
1158+
[Discussion#50](https://github.com/bxparks/AceRoutine/discussions/50)).
1159+
1160+
If the profiling feature is not used, no additional flash memory is consumed.
1161+
The static RAM usage does increase by 2 bytes (8-bits) and 4 bytes (32-bits) per
1162+
coroutine even if this feature is not used. The feature seemed useful enough to
1163+
accept this small increase in static memory size, because most applications will
1164+
not use more than 5-10 coroutines, and that translates into only 10-20 bytes of
1165+
additional static RAM usage on 8-bit processors.
11591166

11601167
The following classes and API methods were added to support the profiling
1161-
feature. The `CoroutineProfiler` class is an interface that allows an object to
1162-
receive information about the execution time of the `Coroutine::runCoroutine()`
1163-
method:
1168+
feature. The `CoroutineProfiler` class is an interface whose
1169+
`updateElapsedMicros()` should be called with the execution time of the
1170+
`Coroutine::runCoroutine()` method:
11641171

11651172
```C++
11661173
class CoroutineProfiler {
11671174
public:
1168-
/**
1169-
* Process the completion of the runCoroutine() method which took
1170-
* `micros` microseconds.
1171-
*/
11721175
virtual void updateElapsedMicros(uint32_t micros) = 0;
11731176
};
11741177
```
@@ -1188,14 +1191,17 @@ class Coroutine {
11881191
};
11891192
```
11901193

1194+
The `runCoroutineWithProfiler()` method calls `runCoroutine()`, measures the
1195+
elapsed time in microseconds, then calls the `profiler->updateElapsedMicros()`.
1196+
11911197
**Note**: When creating Coroutines with profiling enabled, it will probably be
11921198
necessary to assign human-readable names to each coroutine for identification
11931199
purposes. See [Coroutine Names](#CoroutineNames) for information on the
11941200
`setName()`, `getCName()`, `getFName()`, `getNameType()`, and `printNameTo()`
11951201
methods. Each coroutine name will consume additional flash memory.
11961202

11971203
Currently only a single implementation of `CoroutineProfiler` is provided, the
1198-
`LogBinProfiler`. It contains 32 bins of `uint16_t` which tracks the number of
1204+
`LogBinProfiler`. It contains 32 bins of `uint16_t` which track the number of
11991205
times a `micros` was seen. The bins are logarithmically scaled, so that Bin 0
12001206
collects all events `<2us`, Bin 1 collects events `<4us`, Bin 2 collects events
12011207
`<8us`, ..., Bin 30 collects events `<2147s`, and the last Bin 31 collects
@@ -1242,7 +1248,7 @@ COROUTINE(coroutine1) {
12421248
...
12431249
}
12441250
1245-
COROUTINE(coroutine1) {
1251+
COROUTINE(coroutine2) {
12461252
...
12471253
}
12481254
@@ -1275,10 +1281,12 @@ COROUTINE(coroutine1) {
12751281
...
12761282
}
12771283

1278-
COROUTINE(coroutine1) {
1284+
COROUTINE(coroutine2) {
12791285
...
12801286
}
12811287

1288+
...
1289+
12821290
void setup() {
12831291
...
12841292
LogBinProfiler::createProfilers();
@@ -1391,7 +1399,7 @@ class LogBinJsonRenderer{
13911399

13921400
* The `printer` is usually the `Serial` object, but can be changed to something
13931401
else if needed.
1394-
* The `startBin` (0-31) and `endBin` (0-32) identify the bins which should be
1402+
* The `startBin` [0-31] and `endBin` [0-32] identify the bins which should be
13951403
printed.
13961404
* A range of something like [2, 13) is useful to keep the width of the table
13971405
reasonable.
@@ -1423,6 +1431,9 @@ this:
14231431
}
14241432
```
14251433

1434+
The `LogBinProfiler` uses a `uint16_t` counter, so the maximum value is
1435+
saturated to `65535`.
1436+
14261437
<a name="ProfilerResourceConsumption"></a>
14271438
### Profiler Resource Consumption
14281439

@@ -1459,13 +1470,13 @@ If the profiling feature is enabled, the
14591470

14601471
The [AutoBenchmark](examples/AutoBenchmark) program shows that calling the
14611472
profiler-enabled methods, `Coroutine::runCoroutineWithProfiler()` and
1462-
`CoroutineScheduler::loopWithProfiler(), increases latency by:
1473+
`CoroutineScheduler::loopWithProfiler()`, increases latency by:
14631474

1464-
* 3 - 3.2 micros on AVR
1475+
* 2.2 - 3.0 micros on AVR
14651476
* 0.4 micros on STM32F1
14661477
* 0.2 - 0.3 micros on ESP8266
14671478
* 0.1 micros on ESP32
1468-
* 0.033 - 0.166 micros on Teensy 3.2
1479+
* 0.03 - 0.17 micros on Teensy 3.2
14691480

14701481
On 32-bit processors, the overhead seems neglegible. On 8-bit processors, the 3
14711482
microsecond of overhead might be an issue with sensitive applications.

0 commit comments

Comments
 (0)