ads1115 only
Fork of mbed by
Diff: Ticker.h
- Revision:
- 66:9c8f0e3462fb
- Parent:
- 65:5798e58a58b1
- Child:
- 68:f37f3b9c9f0b
--- a/Ticker.h Mon Aug 12 13:17:46 2013 +0300 +++ b/Ticker.h Mon Aug 19 13:34:54 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; }