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.
Revision 2:65fd472f6314, committed 2018-12-13
- Comitter:
- bignick26
- Date:
- Thu Dec 13 21:28:56 2018 +0000
- Parent:
- 1:6d68eb9b6bbb
- Commit message:
- Changed the definition of how to receive a PWM input such that when no signal is received, the output of the function dutycycle() is 0.0, instead of holding the last value received.
Changed in this revision
| PwmIn.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/PwmIn.cpp Thu Sep 02 18:17:35 2010 +0000
+++ b/PwmIn.cpp Thu Dec 13 21:28:56 2018 +0000
@@ -39,6 +39,10 @@
}
float PwmIn::dutycycle() {
+ if (_t.read() > 1.0) {
+ //detach iterrupt?
+ return 0;
+ }
return _pulsewidth / _period;
}