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: SSD1306_smart_watch
Fork of mbed-src by
Diff: common/Ticker.cpp
- Revision:
- 15:4892fe388435
- Parent:
- 13:0645d8841f51
- Child:
- 36:ab3ee77451e7
diff -r 096882eb0961 -r 4892fe388435 common/Ticker.cpp
--- a/common/Ticker.cpp	Mon Aug 05 14:54:27 2013 +0000
+++ b/common/Ticker.cpp	Wed Aug 07 16:43:59 2013 +0300
@@ -22,7 +22,7 @@
 
 void Ticker::detach() {
     remove();
-    _function.attach(0);
+    _chain.clear();
 }
 
 void Ticker::setup(unsigned int t) {
@@ -33,7 +33,13 @@
 
 void Ticker::handler() {
     insert(event.timestamp + _delay);
-    _function.call();
+    _chain.call();
+}
+
+pFunctionPointer_t Ticker::add_function_helper(void (*fptr)(void), bool front) {
+    if (_chain.size() == 0)
+        return NULL;
+    return front ? _chain.add_front(fptr) : _chain.add(fptr);
 }
 
 } // namespace mbed
    