aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2018-09-07 05:01:55 -0600
committerSelene ToyKeeper2018-09-07 05:01:55 -0600
commit603ed49e5d901a6efd077012c75a999d908c02c7 (patch)
tree0999114af27951cc03ee29112f704b625ff6d62e
parentmerged recent updates from Anduril, removed non-Emisar build targets (diff)
downloadanduril-603ed49e5d901a6efd077012c75a999d908c02c7.tar.gz
anduril-603ed49e5d901a6efd077012c75a999d908c02c7.tar.bz2
anduril-603ed49e5d901a6efd077012c75a999d908c02c7.zip
fixed bug: clicking MAX_CLICKS+1 times and holding the final click would hang the MCU
(also, reduced ROM size)
-rw-r--r--spaghetti-monster/fsm-events.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/spaghetti-monster/fsm-events.c b/spaghetti-monster/fsm-events.c
index c71e822..ee7bc97 100644
--- a/spaghetti-monster/fsm-events.c
+++ b/spaghetti-monster/fsm-events.c
@@ -50,10 +50,14 @@ void empty_event_sequence() {
uint8_t push_event(uint8_t ev_type) {
ticks_since_last_event = 0; // something happened
uint8_t i;
- uint8_t prev_event = 0; // never push the same event twice in a row
- for(i=0; current_event[i] && (i<EV_MAX_LEN); i++)
- prev_event = current_event[i];
- if ((i < EV_MAX_LEN-1) && (prev_event != ev_type)) {
+ //uint8_t prev_event = 0; // never push the same event twice in a row
+ for(i=0; current_event[i] && (i<EV_MAX_LEN); i++) {
+ // this doesn't actually seem to be necessary any more...
+ //prev_event = current_event[i];
+ }
+ //if ((i < EV_MAX_LEN) && (prev_event != ev_type)) {
+ //if (prev_event != ev_type) {
+ if (i < EV_MAX_LEN) {
current_event[i] = ev_type;
return 1; // event pushed
} else {
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.