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.
Dependencies: mbed Watchdog SDFileSystem DigoleSerialDisp
SimpleFilter/SimpleFilter.cpp@25:bb5356402687, 2018-11-30 (annotated)
- Committer:
- shimniok
- Date:
- Fri Nov 30 16:11:53 2018 +0000
- Revision:
- 25:bb5356402687
- Parent:
- 0:a6a169de725f
Initial publish of revised version.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| shimniok | 0:a6a169de725f | 1 | #include "SimpleFilter.h" |
| shimniok | 0:a6a169de725f | 2 | |
| shimniok | 0:a6a169de725f | 3 | SimpleFilter::SimpleFilter(short shift): _filter_value(0), _shift(shift) { |
| shimniok | 0:a6a169de725f | 4 | // nothing to do here, really |
| shimniok | 0:a6a169de725f | 5 | } |
| shimniok | 0:a6a169de725f | 6 | |
| shimniok | 0:a6a169de725f | 7 | short SimpleFilter::filter(short value) { |
| shimniok | 0:a6a169de725f | 8 | |
| shimniok | 0:a6a169de725f | 9 | _filter_value += (value - (_filter_value >> _shift)); |
| shimniok | 0:a6a169de725f | 10 | |
| shimniok | 0:a6a169de725f | 11 | return _filter_value >> _shift; |
| shimniok | 0:a6a169de725f | 12 | } |
| shimniok | 0:a6a169de725f | 13 | |
| shimniok | 0:a6a169de725f | 14 | short SimpleFilter::value(void) { |
| shimniok | 0:a6a169de725f | 15 | return _filter_value >> _shift; |
| shimniok | 0:a6a169de725f | 16 | } |