aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-pcint.h
diff options
context:
space:
mode:
authorSelene ToyKeeper2017-12-11 19:56:15 -0700
committerSelene ToyKeeper2017-12-11 19:56:15 -0700
commitd50c46d08a6d7f52dffb9b43784c62b11d78df8c (patch)
treeba93cc6fa1d3f681e850d57ed92721e859b4ff30 /spaghetti-monster/fsm-pcint.h
parentWorking toward a FW3A release now. Made strobes use Nx7135 (when available) ... (diff)
downloadanduril-d50c46d08a6d7f52dffb9b43784c62b11d78df8c.tar.gz
anduril-d50c46d08a6d7f52dffb9b43784c62b11d78df8c.tar.bz2
anduril-d50c46d08a6d7f52dffb9b43784c62b11d78df8c.zip
Greatly improved button debouncing. Helps a lot on FW3A and my light saber.
Debouncing isn't 100% yet though.
Diffstat (limited to 'spaghetti-monster/fsm-pcint.h')
-rw-r--r--spaghetti-monster/fsm-pcint.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/spaghetti-monster/fsm-pcint.h b/spaghetti-monster/fsm-pcint.h
index cda5ad7..a94fc82 100644
--- a/spaghetti-monster/fsm-pcint.h
+++ b/spaghetti-monster/fsm-pcint.h
@@ -21,9 +21,12 @@
#define FSM_PCINT_H
//static volatile uint8_t button_was_pressed;
-#define BP_SAMPLES 16
+#define BP_SAMPLES 32
+volatile uint8_t button_last_state;
+volatile uint8_t PCINT_since_WDT;
uint8_t button_is_pressed();
inline void PCINT_on();
inline void PCINT_off();
+void PCINT_inner(uint8_t pressed);
#endif