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: RedButton WS_7_Seg_mit_LM1635 WS_7_Seg_mit_LM1635 Lichtschalter_M0 ... more
Diff: Debouncer.cpp
- Revision:
- 2:7f2f00805d41
- Parent:
- 1:e59480cf6c72
diff -r e59480cf6c72 -r 7f2f00805d41 Debouncer.cpp
--- a/Debouncer.cpp Mon May 18 13:08:33 2015 +0000
+++ b/Debouncer.cpp Mon May 18 13:25:07 2015 +0000
@@ -68,14 +68,14 @@
//! \param pin Pin to poll.
//! \param mode Pin mode, e.g. \a PullUp or \a PullDown.
Debouncer::Debouncer(PinName pin, PinMode mode)
- : in(pin, mode), now(mode == PullUp), previous(mode == PullUp ? -1 : 0)
+ : in(pin, mode), previous(mode == PullUp ? -1 : 0), now(mode == PullUp)
{
samples(); period();
}
//! Set the number of identical samples needed to regard the input as stable.
//! \note Limited to at most 32 samples.
-Debouncer &Debouncer::samples(int n)
+Debouncer &Debouncer::samples(uint8_t n)
{
_samples = n;
return *this;