From 1c3cf27c5676d976d3a4b6b70420119b6541250e Mon Sep 17 00:00:00 2001 From: Mike Fiore Date: Fri, 13 Nov 2015 13:07:21 -0600 Subject: update ButtonHandler - ignore presses less than 20 ms --- ButtonHandler/ButtonHandler.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ButtonHandler/ButtonHandler.h') diff --git a/ButtonHandler/ButtonHandler.h b/ButtonHandler/ButtonHandler.h index 3eb8298..cfca1d7 100644 --- a/ButtonHandler/ButtonHandler.h +++ b/ButtonHandler/ButtonHandler.h @@ -24,13 +24,20 @@ class ButtonHandler { void sw1_fall(); void sw1_rise(); void sw2_fall(); + void sw2_rise(); osThreadId _main; InterruptIn _sw1; InterruptIn _sw2; Timer _sw1_timer; + Timer _sw2_timer; time_t _sw1_time; + time_t _sw2_time; + bool _sw1_running; + bool _sw2_running; ButtonEvent _event; + time_t _debounce_time; + time_t _hold_threshold; }; #endif -- cgit v1.2.3