-
Notifications
You must be signed in to change notification settings - Fork 18
0.3 - implement COROUTINE_DELAY_MICROS(); update COROUTINE_DELAY_SECONDS() #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…he program due to destructors (#7)
… ensure that COROUTINE_YIELD() is called at least once even if 'condition' is already true
…IELD() issued by COROUTINE_AWAIT(); add tests/Makefile
…yielding even if the delay is 0
…void ambiguity with global millis() method (#9)
…::micros() function (#9)
…INE_DELAY(), COROUTINE_DELAY_MILLIS() and COROUTINE_DELAY_MICROS() (#9)
…ed in COROUTINE_DELAY_SECONDS()
…ger division by 1000
…eSeconds() and the 2 uint16_t parameters already allocated by COROUTINE_DELAY()
…on 8-bit processors (#9)
…n true (but this should never happen)
…ark results for various boards (#9)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
AutoBenchmark/README.md
benchmark numbers.do-while
loopCOROUTINE_AWAIT()
so that it is guaranteed to callCOROUTINE_YIELD()
at least once. Previously, if thecondition
of theawait was already (or always) true, the
while-loop
caused the coroutineto hog the control flow without yielding.
do-while
loop inCOROUTINE_DELAY()
so thatCOROUTINE_YIELD()
is guaranteed to be called at least once, even if the delay is 0.
COROUTINE_DELAY_MICROS(delayMicros)
which is similar to theexisting
COROUTINE_DELAY(delayMillis)
macro. The actual delay time maybe inaccurate on slow processors (e.g. 16 MHz AVR processors) and become
more accurate for faster processors (e.g. ESP32). (Microsecond Timing? #9)
COROUTINE_DELAY_SECONDS(delaySeconds)
macro now takesonly one parmeter instead of 2 parameters. An external
loopCounter
variable no longer needs to be provided by the caller, which simplifies
the API.
examples/Delay/Delay.ino
program to validate the variousCOROUTINE_DELAY*()
macros.sizeof(Coroutine)
increases from 14 bytes to 15 bytes on an 8-bitprocessor. No change on 32-bit (still 28 bytes).