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: SANFAN_read_analog_value nucleo-wdg Nucleo_sleep_copy
Fork of mbed-src by
Diff: api/Ticker.h
- Revision:
- 19:398f4c622e1b
- Parent:
- 15:4892fe388435
- Child:
- 36:ab3ee77451e7
--- a/api/Ticker.h Mon Aug 12 13:49:01 2013 +0300 +++ b/api/Ticker.h Mon Aug 19 18:17:02 2013 +0300 @@ -104,7 +104,7 @@ */ template<typename T> pFunctionPointer_t attach(T* tptr, void (T::*mptr)(void), float t) { - return attach_us(tptr, mptr, t * 1000000.0f); + return attach_us(tptr, mptr, t * 1000000.0f); } /** Add a function to be called by the Ticker at the end of the call chain @@ -142,6 +142,7 @@ * The function object created for 'fptr' */ pFunctionPointer_t attach_us(void (*fptr)(void), unsigned int t) { + _chain.clear(); pFunctionPointer_t pf = _chain.add(fptr); setup(t); return pf; @@ -158,7 +159,8 @@ */ template<typename T> pFunctionPointer_t attach_us(T* tptr, void (T::*mptr)(void), unsigned int t) { - pFunctionPointer_t pf = _chain.add(mptr, tptr); + _chain.clear(); + pFunctionPointer_t pf = _chain.add(tptr, mptr); setup(t); return pf; }