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.
Fork of ESC by
Revision 1:735702ea5519, committed 2013-07-19
- Comitter:
- MatteoT
- Date:
- Fri Jul 19 04:47:41 2013 +0000
- Parent:
- 0:116260c66d88
- Commit message:
- no inline keywords
Changed in this revision
esc.cpp | Show annotated file Show diff for this revision Revisions of this file |
esc.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 116260c66d88 -r 735702ea5519 esc.cpp --- a/esc.cpp Fri Jul 19 03:11:05 2013 +0000 +++ b/esc.cpp Fri Jul 19 04:47:41 2013 +0000 @@ -8,7 +8,7 @@ esc.pulsewidth_us(throttle); } -inline bool ESC::setThrottle (const float t) +bool ESC::setThrottle (const float t) { if (t >= 0.0 && t <= 1.0) { // qualify range, 0-1 throttle = 1000.0*t + 1000; // map to range, 1-2 ms (1000-2000us) @@ -16,22 +16,22 @@ } return false; } -inline bool ESC::operator= (const float t){ +bool ESC::operator= (const float t){ return this->setThrottle(t); } -inline float ESC::getThrottle () const{ +float ESC::getThrottle () const{ return throttle; } -inline ESC::operator float () const{ +ESC::operator float () const{ return this->getThrottle(); } -inline void ESC::pulse () +void ESC::pulse () { esc.pulsewidth_us(throttle); } -inline void ESC::operator() () +void ESC::operator() () { this->pulse(); } \ No newline at end of file
diff -r 116260c66d88 -r 735702ea5519 esc.h --- a/esc.h Fri Jul 19 03:11:05 2013 +0000 +++ b/esc.h Fri Jul 19 04:47:41 2013 +0000 @@ -104,22 +104,22 @@ * @param t in in the range [0.0;1.0] * @return true if throttle value is in range; false otherwise. */ - inline bool setThrottle (const float t); + bool setThrottle (const float t); ///Alias of setThrottle(float) - inline bool operator= (const float t); + bool operator= (const float t); /** Get the last setted throttle value * @return throttle in range [0.0-1.0]. */ - inline float getThrottle () const; + float getThrottle () const; ///Alias of getThrottle() - inline operator float () const; + operator float () const; /** Output the throttle value to the ESC. */ - inline void pulse (); + void pulse (); ///Alias of pulse() - inline void operator() (); + void operator() (); }; #endif \ No newline at end of file