aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2018-11-11 16:00:12 -0700
committerSelene ToyKeeper2018-11-11 16:00:12 -0700
commita71c92e1f27a1ffe513bd0488011f3b6097455da (patch)
treee93424be04ee5f261f01b9562c29a81dad41afe8
parentSeveral fixes... (diff)
downloadanduril-a71c92e1f27a1ffe513bd0488011f3b6097455da.tar.gz
anduril-a71c92e1f27a1ffe513bd0488011f3b6097455da.tar.bz2
anduril-a71c92e1f27a1ffe513bd0488011f3b6097455da.zip
Fixed the corner case of a button release when the previous state was already released.
-rw-r--r--spaghetti-monster/fsm-events.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/spaghetti-monster/fsm-events.c b/spaghetti-monster/fsm-events.c
index b36c9f4..72216ae 100644
--- a/spaghetti-monster/fsm-events.c
+++ b/spaghetti-monster/fsm-events.c
@@ -50,7 +50,7 @@ uint8_t push_event(uint8_t ev_type) {
// handle button releases
else if (ev_type == B_RELEASE) {
// clear the press flag
- current_event ^= B_PRESS;
+ current_event &= (~B_PRESS);
// if a "hold" event just ended, set the timeout flag
// to indicate that the event is done and can be cleared
if (current_event & B_HOLD) { current_event |= B_TIMEOUT; }
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.