A low-memory, fast-switching, cooperative multitasking library using stackless coroutines on Arduino platforms.
MIT License
Published by bxparks about 2 years ago
Published by bxparks over 2 years ago
USER_GUIDE.md
.Coroutine
class: setName()
,setName()
, getCName()
, getFName()
, getNameType()
, andprintNameTo()
.Coroutine::runCoroutine()
execution time.
USER_GUIDE.md
.CoroutineProfiler
interface with a updateElapsedMicros()
Coroutine::setProfiler()
to store the profiler pointer.Coroutine::runCoroutineWithProfiler()
which measures therunCoroutine()
and callsCoroutineProfiler::updateElapsedMicros()
.CoroutineScheduler::runCoroutineWithProfiler()
which callsCoroutine::runCoroutineWithProfiler()
instead of the normalCoroutine::runCoroutine()
.CoroutineScheduler::loopWithProfiler()
public static methodrunCoroutineWithProfiler()
.LogBinProfiler
subclass of CoroutineProfiler
.
log2()
function of the elapsed microseconds.LogBinProfiler
:
LogBinTableRenderer::printTo()
prints a formatted table of theLogBinJsonRenderer::printTo()
prints the frequency countsetName()
and setProfiler()
Coroutine::sStatusStrings
to PROGMEM
CoroutineScheduler::list()
is used.Published by bxparks over 2 years ago
libraries.properties
.
tests/
and examples/
still depend it though,examples/ChannelBenchmark
and its README.md
.
generate_readme.py
and generate_table.awk
scripts, just likeexamples/AutoBenchmark
.Published by bxparks over 2 years ago
examples/SoundManager
to demonstrate coroutines defined inPrint::println()
to print \r\n
instead of just \n
.Published by bxparks about 3 years ago
Coroutine::setupCoroutine()
with a default emptyCoroutineScheduler::setupCoroutines()
toCoroutine::setupCoroutine()
increases flash consumptionCoroutine::setupCoroutine()
can consume a significantPublished by bxparks over 3 years ago
COROUTINE_DELAY_MICROS()
and `COROUTINE_DELAY_SECONDS(),Coroutine
itself knows whether it is delaying in units ofCoroutineScheduler::runCoroutine()
always call intoCoroutine::runCoroutine()
when the Coroutine::mStatus
is delaying,Coroutine
does not need a runtime mDelayType
descriminator.COROUTINE_DELAY_MICROS()
andCOROUTINE_DELAY_SECONDS()
is not pulled into the program if they arePublished by bxparks over 3 years ago
Coroutine
destructor from virtual toCoroutine
into CoroutineTemplate
class.CoroutineScheduler
into CoroutineSchedulerTemplate
class.
Coroutine
to be CoroutineTemplate<ClockInterface>
, almostCoroutineScheduler
to beCoroutineSchedulerTemplate<Coroutine>
, almost fully backwardsCOROUTINE()
, COROUTINE_DELAY()
,COROUTINE_YIELD()
, etc) should work as before.Coroutine
(coroutineMicros()
, coroutineMillis()
,coroutineSeconds()
) with a injectable ClockInterface
templateCoroutine::coroutineMicros()
,Coroutine::coroutineMillis()
, and Coroutine::coroutineSeconds()
private static
functions which delegate toClockInterface::micros()
, ClockInterface::millis()
, andClockInterface::sesconds()
.TestableClockInterface
for testing.TestableCoroutine
for testing.TestableCoroutineScheduler
for testing.COROUTINE_DELAY_SECONDS()
.
COROUTINE_DELAY()
,COROUTINE_DELAY_MICROS()
.
COROUTINE_DELAY_MICROS()
was never reliable because it dependedCoroutine::getName()
and Coroutine::mName
. ThesetupCoroutineOrderedByName()
, since it is no longer possiblesetupCoroutine()
functionality directly intoCoroutine::Coroutine()
constructor.setupCoroutine(const char*)
and setupCoroutine(const __FlashStringHelper*)
into no-ops. They are retained for backwardsCoroutineScheduler::list()
, since the name is no longer retained.Coroutine::runCoroutine()
on 8-bitCoroutineScheduler
to 32-bit processors withPublished by bxparks almost 4 years ago
Published by bxparks almost 4 years ago
AutoBenchmark
to automate data collection.MemoryBenchmark
and AutoBenchmark
tables with STM32; re-addPublished by bxparks almost 4 years ago
FPSTR()
macro for unrecognized platforms.ARDUINO_ARCH_STM32
dependencies to compile. I willAce*
Published by bxparks almost 4 years ago
DEVELOPER.md
notes to myself.Published by bxparks almost 4 years ago
resume()
is called immediately after suspend()
, without waiting forCoroutineScheduler::loop()
to actually remove the coroutine from theCoroutine::reset()
which prevented it fromCoroutine::getRoot()
and Coroutine::getNext()
public methods are nowsetupCoroutineOrderedByName()
methods replicate the oldsuspend()
and resume()
README.md
into USER_GUIDE.md
. AddPublished by bxparks almost 4 years ago
Coroutine::reset()
method that causes the Coroutine to restartsrc/ace_routine/cli
to the AceUtils libraryPublished by bxparks about 4 years ago
Published by bxparks about 5 years ago
examples/
.Flash.h' to
compat.h. Reenable
F()` strings for ESP8266.examples/
to work using clang++ (usingPublished by bxparks about 5 years ago
AutoBenchmark/README.md
benchmark numbers.do-while
loop COROUTINE_AWAIT()
so that it is guaranteed to callCOROUTINE_YIELD()
at least once. Previously, if the condition
of thewhile-loop
caused the coroutinedo-while
loop in COROUTINE_DELAY()
so that COROUTINE_YIELD()
COROUTINE_DELAY_MICROS(delayMicros)
which is similar to theCOROUTINE_DELAY(delayMillis)
macro. The actual delay time mayCOROUTINE_DELAY_SECONDS(delaySeconds)
macro now takesloopCounter
examples/Delay/Delay.ino
program to validate the variousCOROUTINE_DELAY*()
macros.sizeof(Coroutine)
increases from 14 bytes to 15 bytes on an 8-bitPublished by bxparks about 5 years ago
SHIFT_ARGC_ARGV()
macro for easy token shifting,isArgEqual()
method for easy comparison against flash stringUnixHostDuino
.cli
library due to local c
variable insideCOROUTINE_LOOP
macro.Published by bxparks over 5 years ago
pinMode()
in some examples.ACE_ROUTINE_VERSION_STRING
for easier display for version number.Published by bxparks about 6 years ago
COROUTINE_DELAY_SECONDS()
to support delays longer thanauniter.ini
and Jenkinsfile
for compatibility withkStatusAwaiting
state used by COROUTINE_AWAIT()
whichkStatusYielding
.CoroutineScheduler::list()
.COROUTINE_CHANNEL_READ()
and COROUTINE_CHANNEL_WRITE()
ChannelBenchmark
to determine the CPU overhead of usingcli
library to use channels to read from serial portCommandHandler
from a pointer to function to a fullCoroutine::run()
to Coroutine::runCoroutine()
for clarity.Coroutine::init()
to Coroutine::setupCoroutine()
to makePublished by bxparks about 6 years ago