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 HardwareTimersLib by
Revision 14:960fbd85909f, committed 2014-03-16
- Comitter:
- mgottscho
- Date:
- Sun Mar 16 01:08:20 2014 +0000
- Parent:
- 13:3564122e9c10
- Commit message:
- Bug fix.
Changed in this revision
| HardwareTimer.cpp | Show annotated file Show diff for this revision Revisions of this file |
| HardwareTimer.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/HardwareTimer.cpp Tue Mar 11 05:49:26 2014 +0000
+++ b/HardwareTimer.cpp Sun Mar 16 01:08:20 2014 +0000
@@ -84,7 +84,12 @@
if (__enabled)
disable();
- __user_fptr = new FunctionPointer(tptr, mptr);
+
+ //set user function pointer
+ if (__user_fptr != NULL)
+ delete __user_fptr;
+ if (tptr != NULL && mptr != NULL)
+ __user_fptr = new FunctionPointer(tptr, mptr);
__init_timer(); //Do hardware-specific initialization
--- a/HardwareTimer.h Tue Mar 11 05:49:26 2014 +0000
+++ b/HardwareTimer.h Sun Mar 16 01:08:20 2014 +0000
@@ -76,7 +76,7 @@
* @param tptr the object
* @param mptr method to call on the object
*/
- template <typename T> void enable(T *tptr, void (T::*mptr)(void));
+ template<typename T> void enable(T *tptr, void (T::*mptr)(void));
/**
* Stops and disables the timer. No user function callbacks will be made, and the tick value stops increasing.
