Debounce InterruptIn

Dependents:   led_sigfox Allumag_lampe_sigfox Case_study_02_Turnstile B18_MP3_PLAYER ... more

Revision:
7:2d73e219dadf
Parent:
5:3c0f741fb448
Child:
8:4b3ff16d5f91
--- a/DebounceInterrupts.h	Tue Feb 18 06:46:06 2014 +0000
+++ b/DebounceInterrupts.h	Tue Feb 18 07:00:07 2014 +0000
@@ -34,14 +34,22 @@
 
 class DebounceInterrupts {
 private:
-    unsigned int fDebounce_us;
+    unsigned int _debounce_us;
+    unsigned int _debounce_count;
+    
     void (*fCallback)(void);
     void _onInterrupt(void);
+    void _callback(void);
 public:
     DebounceInterrupts(void (*fptr)(void),                  /* function to be called after debounced InterruptIn */
                        InterruptIn *interrupt,              /* InterruptIn to monitor */
                        const interruptTrigger& trigger,     /* true: rise, false: fall */
                        const uint32_t& debounce_ms=10);     /* stability duration required */
     ~DebounceInterrupts();
+    /*
+    * Get number of de-bounced interrupts
+    * @return: debounced count
+    */
+    unsigned int get_debounce();
 };
 #endif
\ No newline at end of file