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: triforce-control usbjoystick_prg
Revision 7:2a58e3363242, committed 2014-05-19
- Comitter:
- pHysiX
- Date:
- Mon May 19 16:04:34 2014 +0000
- Parent:
- 6:e1df0b4f36e4
- Commit message:
- Removed mutex. Bad and incorrect of mutex for an ISR
Changed in this revision
PwmIn.cpp | Show annotated file Show diff for this revision Revisions of this file |
PwmIn.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/PwmIn.cpp Mon May 19 15:43:02 2014 +0000 +++ b/PwmIn.cpp Mon May 19 16:04:34 2014 +0000 @@ -36,18 +36,14 @@ void PwmIn::rise() { - mutex_var_update.lock(); _period = _t.read_us(); stallTimer.reset(); - mutex_var_update.unlock(); _t.reset(); } void PwmIn::fall() { - mutex_var_update.lock(); _pulsewidth = _t.read_us(); - mutex_var_update.unlock(); if (!stallInit) stallTimer.start(); }
--- a/PwmIn.h Mon May 19 15:43:02 2014 +0000 +++ b/PwmIn.h Mon May 19 16:04:34 2014 +0000 @@ -21,7 +21,6 @@ * THE SOFTWARE. */ #include "mbed.h" -#include "rtos.h" #ifndef MBED_PWMIN_H_ #define MBED_PWMIN_H_ @@ -67,8 +66,6 @@ */ Timer stallTimer; protected: - Mutex mutex_var_update; - InterruptIn _p; Timer _t; volatile int _pulsewidth, _period;