Skip to content

Commit

Permalink
Updated firstTriggered() method making it more efficient.
Browse files Browse the repository at this point in the history
  • Loading branch information
EasyG0ing1 committed Nov 30, 2023
1 parent f8e67df commit 4ef9930
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,9 @@ simply make sure that only one thread will ever be causing changes to happen in
# Version Update Notes
### 2.1.3
- Changed `firstTrigger()` so that it does not run any calculations after it has triggered making subsequent calls more efficient.
### 2.1.2
- Bug Fix
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=BlockNot
version=2.1.2
version=2.1.3
author=Michael Sims <[email protected]>
maintainer=Michael Sims <[email protected]>
sentence=BlockNot gives you non-blocking timers with simplicity.
paragraph=Added lastTriggerDuration() method. Stop using delay() in your code because it stops the execution of your code until the timer has finished. BlockNot's design focus is always SIMPLICITY and COMMON SENSE. It uses common sense terms which simplifies the reading and writing of your code. It offers, among several things, convenient AND SIMPLE timer functionality, but most of all ... it gets you away from blocking methods, like delay() - as a means of managing events in your code. Non-Blocking is the proper way to implement timing events in Arduino code and BlockNot makes it easy while also offering the ability to branch your code using many different references to time. Check out the documentation by clicking on More info.
paragraph=Stop using delay() in your code because it stops the execution of your code until the timer has finished. BlockNot's design focus is always SIMPLICITY and COMMON SENSE. It uses common sense terms which simplifies the reading and writing of your code. It offers, among several things, convenient AND SIMPLE timer functionality, but most of all ... it gets you away from blocking methods, like delay() - as a means of managing events in your code. Non-Blocking is the proper way to implement timing events in Arduino code and BlockNot makes it easy while also offering the ability to branch your code using many different references to time. Check out the documentation by clicking on More info.
category=Timing
url=http://github.com/EasyG0ing1/BlockNot
architectures=*
Expand Down
5 changes: 4 additions & 1 deletion src/BlockNot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@ bool BlockNot::notTriggered() {
}

bool BlockNot::firstTrigger() {
if (hasTriggered() && !onceTriggered) {
if(onceTriggered) {
return false;
}
else if (hasTriggered()) {
onceTriggered = true;
return timerState == RUNNING;
}
Expand Down

0 comments on commit 4ef9930

Please sign in to comment.