Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Microwave_MBED MicrowaveSimulation_LPC1768 RTOS_Alarm_Clock USB_Project_Host ... more
Diff: DebounceInterrupts.h
- 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